Skip to content

Commit c29d772

Browse files
committed
Simplify examples
1 parent 9483e27 commit c29d772

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/io/read_exact.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ use io::Read;
1616
/// use nb::io::read_exact;
1717
///
1818
/// let source = [5, 6, 7];
19-
/// let reader = &mut &source[..];
20-
///
21-
/// let mut reading = read_exact(reader, [0, 0]);
19+
/// let mut reading = read_exact(&source[..], [0, 0]);
2220
/// let (_, buffer) = block!(reading.poll()).ok().unwrap();
2321
/// assert_eq!(buffer, [5, 6]);
2422
/// # }

src/io/write_all.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ use io::Write;
1717
///
1818
/// let mut buffer = [0; 3];
1919
/// {
20-
/// let writer = &mut buffer[..];
21-
/// let mut writing = write_all(writer, [5, 6]);
20+
/// let mut writing = write_all(&mut buffer[..], [5, 6]);
2221
/// block!(writing.poll()).ok().unwrap();
2322
/// }
2423
/// assert_eq!(buffer, [5, 6, 0]);

0 commit comments

Comments
 (0)