diff --git a/src/libstd/io/buffered.rs b/src/libstd/io/buffered.rs index 9cd8dbcc50949..a01787c286bb9 100644 --- a/src/libstd/io/buffered.rs +++ b/src/libstd/io/buffered.rs @@ -130,14 +130,13 @@ impl Reader for BufferedReader { /// # Example /// /// ```rust -/// # #![allow(unused_must_use)] /// use std::io::{BufferedWriter, File}; /// -/// let file = File::open(&Path::new("message.txt")); +/// let file = File::create(&Path::new("message.txt")).unwrap(); /// let mut writer = BufferedWriter::new(file); /// -/// writer.write_str("hello, world"); -/// writer.flush(); +/// writer.write_str("hello, world").unwrap(); +/// writer.flush().unwrap(); /// ``` pub struct BufferedWriter { inner: Option,