Skip to content

Commit 39ab56c

Browse files
Rollup merge of #44712 - oconnor663:copy_test, r=GuillaumeGomez
fix an incorrect assertion in the doc example for `std::io::copy` I think this wasn't caught by CI because the `foo` wrapper function was only defined and not called. This seems to be the norm for doc examples that define a `foo` function. Is that on purpose?
2 parents 3cf088f + c9099ff commit 39ab56c

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)