Skip to content

Commit c9099ff

Browse files
committed
fix an incorrect assertion in the doc example for std::io::copy
1 parent f60bc3a commit c9099ff

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/libstd/io/util.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@ use mem;
4040
///
4141
/// io::copy(&mut reader, &mut writer)?;
4242
///
43-
/// assert_eq!(reader, &writer[..]);
43+
/// assert_eq!(&b"hello"[..], &writer[..]);
4444
/// # Ok(())
4545
/// # }
46+
/// # foo().unwrap();
4647
/// ```
4748
#[stable(feature = "rust1", since = "1.0.0")]
4849
pub fn copy<R: ?Sized, W: ?Sized>(reader: &mut R, writer: &mut W) -> io::Result<u64>

0 commit comments

Comments
 (0)