Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use 'write_all' instead of 'write' in example code #59498

Merged
merged 1 commit into from
Mar 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/libstd/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
/// }
Expand Down
12 changes: 6 additions & 6 deletions src/libstd/io/stdio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
/// }
Expand All @@ -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(())
/// }
Expand Down Expand Up @@ -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(())
/// }
Expand Down Expand Up @@ -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(())
/// }
Expand All @@ -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(())
/// }
Expand Down Expand Up @@ -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(())
/// }
Expand Down