File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff 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/// ```
You can’t perform that action at this time.
0 commit comments