diff options
| author | Matt Brubeck <mbrubeck@limpet.net> | 2019-03-28 11:28:39 -0700 |
|---|---|---|
| committer | Matt Brubeck <mbrubeck@limpet.net> | 2019-03-28 11:28:50 -0700 |
| commit | 8dbae794b0683668d1b46d2c319ab36dcd9bd96d (patch) | |
| tree | bafc4378301c884329d7051817bf8e102d37c698 /src/libstd | |
| parent | 237bf3244fffef501cf37d4bda00e1fce3fcfb46 (diff) | |
| download | rust-8dbae794b0683668d1b46d2c319ab36dcd9bd96d.tar.gz rust-8dbae794b0683668d1b46d2c319ab36dcd9bd96d.zip | |
Use write_all instead of write in example code
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/io/mod.rs | 2 | ||||
| -rw-r--r-- | src/libstd/io/stdio.rs | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index 7147b641e47..14c850b6b05 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -1151,7 +1151,7 @@ pub trait Write { /// fn main() -> std::io::Result<()> { /// let mut buffer = BufWriter::new(File::create("foo.txt")?); /// - /// buffer.write(b"some bytes")?; + /// buffer.write_all(b"some bytes")?; /// buffer.flush()?; /// Ok(()) /// } diff --git a/src/libstd/io/stdio.rs b/src/libstd/io/stdio.rs index d53a294fa6a..7e151041a9e 100644 --- a/src/libstd/io/stdio.rs +++ b/src/libstd/io/stdio.rs @@ -405,7 +405,7 @@ pub struct StdoutLock<'a> { /// use std::io::{self, Write}; /// /// fn main() -> io::Result<()> { -/// io::stdout().write(b"hello world")?; +/// io::stdout().write_all(b"hello world")?; /// /// Ok(()) /// } @@ -420,7 +420,7 @@ pub struct StdoutLock<'a> { /// let stdout = io::stdout(); /// let mut handle = stdout.lock(); /// -/// handle.write(b"hello world")?; +/// handle.write_all(b"hello world")?; /// /// Ok(()) /// } @@ -460,7 +460,7 @@ impl Stdout { /// let stdout = io::stdout(); /// let mut handle = stdout.lock(); /// - /// handle.write(b"hello world")?; + /// handle.write_all(b"hello world")?; /// /// Ok(()) /// } @@ -558,7 +558,7 @@ pub struct StderrLock<'a> { /// use std::io::{self, Write}; /// /// fn main() -> io::Result<()> { -/// io::stderr().write(b"hello world")?; +/// io::stderr().write_all(b"hello world")?; /// /// Ok(()) /// } @@ -573,7 +573,7 @@ pub struct StderrLock<'a> { /// let stderr = io::stderr(); /// let mut handle = stderr.lock(); /// -/// handle.write(b"hello world")?; +/// handle.write_all(b"hello world")?; /// /// Ok(()) /// } @@ -613,7 +613,7 @@ impl Stderr { /// let stderr = io::stderr(); /// let mut handle = stderr.lock(); /// - /// handle.write(b"hello world")?; + /// handle.write_all(b"hello world")?; /// /// Ok(()) /// } |
