File tree 1 file changed +4
-5
lines changed
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> {
756
756
///
757
757
/// // No bytes are written until a newline is encountered (or
758
758
/// // 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")?, "");
760
760
/// file.write_all(b"\n")?;
761
761
/// 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",
764
764
/// );
765
765
///
766
766
/// // Write the rest of the poem.
@@ -775,8 +775,7 @@ impl<W> fmt::Display for IntoInnerError<W> {
775
775
/// file.flush()?;
776
776
///
777
777
/// // 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[..]);
780
779
/// Ok(())
781
780
/// }
782
781
/// ```
You can’t perform that action at this time.
0 commit comments