Rollup merge of #94957 - iamzhangyong:explanation-read_line, r=Dylan-DPC

Improve the explanation about the behaviour of read_line

Close issue like https://github.com/rust-lang/book/issues/2574
This commit is contained in:
Dylan DPC 2022-03-16 03:34:34 +01:00 committed by GitHub
commit 0732ea2f3e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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