Skip to content

Commit

Permalink
Rollup merge of rust-lang#94957 - iamzhangyong:explanation-read_line,…
Browse files Browse the repository at this point in the history
… r=Dylan-DPC

Improve the explanation about the behaviour of read_line

Close issue like rust-lang/book#2574
  • Loading branch information
Dylan-DPC committed Mar 16, 2022
2 parents 35bce11 + 2c06c86 commit 0732ea2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion library/std/src/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2110,7 +2110,8 @@ pub trait BufRead: Read {
}

/// Read all bytes until a newline (the `0xA` byte) is reached, and append
/// them to the provided buffer.
/// them to the provided buffer. You do not need to clear the buffer before
/// appending.
///
/// This function will read bytes from the underlying stream until the
/// newline delimiter (the `0xA` byte) or EOF is found. Once found, all bytes
Expand Down

0 comments on commit 0732ea2

Please sign in to comment.