diff options
| author | Andy Russell <arussell123@gmail.com> | 2018-07-11 14:39:22 -0400 |
|---|---|---|
| committer | Andy Russell <arussell123@gmail.com> | 2018-07-11 14:39:22 -0400 |
| commit | c12a75742485dcc3db7b0f374e78f090c323830d (patch) | |
| tree | d92b9167e19db3fffcc5212973dbfffdc48cc581 /src/libstd | |
| parent | a1e1b5c3fb599ea8ea7ec7f785f3cc35c3be9666 (diff) | |
| download | rust-c12a75742485dcc3db7b0f374e78f090c323830d.tar.gz rust-c12a75742485dcc3db7b0f374e78f090c323830d.zip | |
simplify assertions
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/io/buffered.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/libstd/io/buffered.rs b/src/libstd/io/buffered.rs index ed085d5c0df..189569683a9 100644 --- a/src/libstd/io/buffered.rs +++ b/src/libstd/io/buffered.rs @@ -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. @@ -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(()) /// } /// ``` |
