From 72fb8f36881784c24acc3febd429d642ddb64c2c Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Mon, 27 Oct 2014 14:34:47 -0400 Subject: [PATCH] Fix example for BufferedReader Fixes #18197 --- src/libstd/io/buffered.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/libstd/io/buffered.rs b/src/libstd/io/buffered.rs index 95c44e6a3fc89..0316480fc2db3 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,