We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 890e3a7 + a350ca6 commit f47fcc7Copy full SHA for f47fcc7
src/libstd/io/util.rs
@@ -78,14 +78,11 @@ pub struct Empty { _priv: () }
78
/// A slightly sad example of not reading anything into a buffer:
79
///
80
/// ```
81
-/// use std::io;
82
-/// use std::io::Read;
+/// use std::io::{self, Read};
83
84
-/// # fn foo() -> io::Result<String> {
85
/// let mut buffer = String::new();
86
-/// try!(io::empty().read_to_string(&mut buffer));
87
-/// # Ok(buffer)
88
-/// # }
+/// io::empty().read_to_string(&mut buffer).unwrap();
+/// assert!(buffer.is_empty());
89
90
#[stable(feature = "rust1", since = "1.0.0")]
91
pub fn empty() -> Empty { Empty { _priv: () } }
0 commit comments