Skip to content

Commit c12a757

Browse files
committed
simplify assertions
1 parent a1e1b5c commit c12a757

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/libstd/io/buffered.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -756,11 +756,11 @@ impl<W> fmt::Display for IntoInnerError<W> {
756756
///
757757
/// // No bytes are written until a newline is encountered (or
758758
/// // the internal buffer is filled).
759-
/// assert_eq!(fs::read_to_string("poem.txt")?.as_bytes(), b"");
759+
/// assert_eq!(fs::read_to_string("poem.txt")?, "");
760760
/// file.write_all(b"\n")?;
761761
/// assert_eq!(
762-
/// fs::read_to_string("poem.txt")?.as_bytes(),
763-
/// &b"I shall be telling this with a sigh\n"[..],
762+
/// fs::read_to_string("poem.txt")?,
763+
/// "I shall be telling this with a sigh\n",
764764
/// );
765765
///
766766
/// // Write the rest of the poem.
@@ -775,8 +775,7 @@ impl<W> fmt::Display for IntoInnerError<W> {
775775
/// file.flush()?;
776776
///
777777
/// // Confirm the whole poem was written.
778-
/// let mut poem = fs::read_to_string("poem.txt")?;
779-
/// assert_eq!(poem.as_bytes(), &road_not_taken[..]);
778+
/// assert_eq!(fs::read("poem.txt")?, &road_not_taken[..]);
780779
/// Ok(())
781780
/// }
782781
/// ```

0 commit comments

Comments
 (0)