about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2017-09-23 00:29:13 -0400
committerGitHub <noreply@github.com>2017-09-23 00:29:13 -0400
commit075e16b2615ed16db9225bb28048cb334324e071 (patch)
treeb7fe2d5b7dd71af009d7f235f223970ca829f1e5 /src/libstd
parentbdbe6e2b35e106979b066b5c8fb9131e91392e4d (diff)
parentc9099ff11b1d44a4942f448750cafe8e5c2fd915 (diff)
downloadrust-075e16b2615ed16db9225bb28048cb334324e071.tar.gz
rust-075e16b2615ed16db9225bb28048cb334324e071.zip
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?
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/io/util.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libstd/io/util.rs b/src/libstd/io/util.rs
index e20f249d3ea..45d281ee34a 100644
--- a/src/libstd/io/util.rs
+++ b/src/libstd/io/util.rs
@@ -40,9 +40,10 @@ use mem;
 ///
 /// io::copy(&mut reader, &mut writer)?;
 ///
-/// assert_eq!(reader, &writer[..]);
+/// assert_eq!(&b"hello"[..], &writer[..]);
 /// # Ok(())
 /// # }
+/// # foo().unwrap();
 /// ```
 #[stable(feature = "rust1", since = "1.0.0")]
 pub fn copy<R: ?Sized, W: ?Sized>(reader: &mut R, writer: &mut W) -> io::Result<u64>