File tree 2 files changed +8
-8
lines changed
2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -1240,8 +1240,8 @@ impl<'a> IoSlice<'a> {
1240
1240
/// use std::io::IoSlice;
1241
1241
/// use std::ops::Deref;
1242
1242
///
1243
- /// let mut data = [1; 8];
1244
- /// let mut buf = IoSlice::new(&mut data);
1243
+ /// let data = [1; 8];
1244
+ /// let mut buf = IoSlice::new(&data);
1245
1245
///
1246
1246
/// // Mark 3 bytes as read.
1247
1247
/// buf.advance(3);
@@ -1435,10 +1435,10 @@ pub trait Write {
1435
1435
/// use std::fs::File;
1436
1436
///
1437
1437
/// fn main() -> std::io::Result<()> {
1438
- /// let mut data1 = [1; 8];
1439
- /// let mut data2 = [15; 8];
1440
- /// let io_slice1 = IoSlice::new(&mut data1);
1441
- /// let io_slice2 = IoSlice::new(&mut data2);
1438
+ /// let data1 = [1; 8];
1439
+ /// let data2 = [15; 8];
1440
+ /// let io_slice1 = IoSlice::new(&data1);
1441
+ /// let io_slice2 = IoSlice::new(&data2);
1442
1442
///
1443
1443
/// let mut buffer = File::create("foo.txt")?;
1444
1444
///
Original file line number Diff line number Diff line change @@ -583,8 +583,8 @@ impl<'a> SocketAncillary<'a> {
583
583
/// let mut ancillary = SocketAncillary::new(&mut ancillary_buffer[..]);
584
584
/// ancillary.add_fds(&[sock.as_raw_fd()][..]);
585
585
///
586
- /// let mut buf = [1; 8];
587
- /// let mut bufs = &mut [IoSlice::new(&mut buf[..])][..];
586
+ /// let buf = [1; 8];
587
+ /// let mut bufs = &mut [IoSlice::new(&buf[..])][..];
588
588
/// sock.send_vectored_with_ancillary(bufs, &mut ancillary)?;
589
589
/// Ok(())
590
590
/// }
You can’t perform that action at this time.
0 commit comments