File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 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> {
12401240 /// use std::io::IoSlice;
12411241 /// use std::ops::Deref;
12421242 ///
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);
12451245 ///
12461246 /// // Mark 3 bytes as read.
12471247 /// buf.advance(3);
@@ -1435,10 +1435,10 @@ pub trait Write {
14351435 /// use std::fs::File;
14361436 ///
14371437 /// 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);
14421442 ///
14431443 /// let mut buffer = File::create("foo.txt")?;
14441444 ///
Original file line number Diff line number Diff line change @@ -583,8 +583,8 @@ impl<'a> SocketAncillary<'a> {
583583 /// let mut ancillary = SocketAncillary::new(&mut ancillary_buffer[..]);
584584 /// ancillary.add_fds(&[sock.as_raw_fd()][..]);
585585 ///
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[..])][..];
588588 /// sock.send_vectored_with_ancillary(bufs, &mut ancillary)?;
589589 /// Ok(())
590590 /// }
You can’t perform that action at this time.
0 commit comments