Skip to content

Commit

Permalink
Rollup merge of rust-lang#34517 - frewsxcv:empty, r=GuillaumeGomez
Browse files Browse the repository at this point in the history
Minor rewrite of `std::io::empty` doc example.

None
  • Loading branch information
GuillaumeGomez authored Jun 28, 2016
2 parents 890e3a7 + a350ca6 commit f47fcc7
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/libstd/io/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,11 @@ pub struct Empty { _priv: () }
/// A slightly sad example of not reading anything into a buffer:
///
/// ```
/// use std::io;
/// use std::io::Read;
/// use std::io::{self, Read};
///
/// # fn foo() -> io::Result<String> {
/// let mut buffer = String::new();
/// try!(io::empty().read_to_string(&mut buffer));
/// # Ok(buffer)
/// # }
/// io::empty().read_to_string(&mut buffer).unwrap();
/// assert!(buffer.is_empty());
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn empty() -> Empty { Empty { _priv: () } }
Expand Down

0 comments on commit f47fcc7

Please sign in to comment.