simplify assertions

This commit is contained in:
Andy Russell
2018-07-11 14:39:22 -04:00
parent a1e1b5c3fb
commit c12a757424

View File

@@ -756,11 +756,11 @@ impl<W> fmt::Display for IntoInnerError<W> {
/// ///
/// // No bytes are written until a newline is encountered (or /// // No bytes are written until a newline is encountered (or
/// // the internal buffer is filled). /// // 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")?; /// file.write_all(b"\n")?;
/// assert_eq!( /// assert_eq!(
/// fs::read_to_string("poem.txt")?.as_bytes(), /// fs::read_to_string("poem.txt")?,
/// &b"I shall be telling this with a sigh\n"[..], /// "I shall be telling this with a sigh\n",
/// ); /// );
/// ///
/// // Write the rest of the poem. /// // Write the rest of the poem.
@@ -775,8 +775,7 @@ impl<W> fmt::Display for IntoInnerError<W> {
/// file.flush()?; /// file.flush()?;
/// ///
/// // Confirm the whole poem was written. /// // Confirm the whole poem was written.
/// let mut poem = fs::read_to_string("poem.txt")?; /// assert_eq!(fs::read("poem.txt")?, &road_not_taken[..]);
/// assert_eq!(poem.as_bytes(), &road_not_taken[..]);
/// Ok(()) /// Ok(())
/// } /// }
/// ``` /// ```