Skip to content

Commit

Permalink
simplify assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
euclio committed Jul 11, 2018
1 parent a1e1b5c commit c12a757
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/libstd/io/buffered.rs
Original file line number Diff line number Diff line change
Expand Up @@ -756,11 +756,11 @@ impl<W> fmt::Display for IntoInnerError<W> {
///
/// // No bytes are written until a newline is encountered (or
/// // the internal buffer is filled).
/// assert_eq!(fs::read_to_string("poem.txt")?.as_bytes(), b"");
/// assert_eq!(fs::read_to_string("poem.txt")?, "");
/// file.write_all(b"\n")?;
/// assert_eq!(
/// fs::read_to_string("poem.txt")?.as_bytes(),
/// &b"I shall be telling this with a sigh\n"[..],
/// fs::read_to_string("poem.txt")?,
/// "I shall be telling this with a sigh\n",
/// );
///
/// // Write the rest of the poem.
Expand All @@ -775,8 +775,7 @@ impl<W> fmt::Display for IntoInnerError<W> {
/// file.flush()?;
///
/// // Confirm the whole poem was written.
/// let mut poem = fs::read_to_string("poem.txt")?;
/// assert_eq!(poem.as_bytes(), &road_not_taken[..]);
/// assert_eq!(fs::read("poem.txt")?, &road_not_taken[..]);
/// Ok(())
/// }
/// ```
Expand Down

0 comments on commit c12a757

Please sign in to comment.