Skip to content

Commit 0732ea2

Browse files
authored
Rollup merge of rust-lang#94957 - iamzhangyong:explanation-read_line, r=Dylan-DPC
Improve the explanation about the behaviour of read_line Close issue like rust-lang/book#2574
2 parents 35bce11 + 2c06c86 commit 0732ea2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

library/std/src/io/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2110,7 +2110,8 @@ pub trait BufRead: Read {
21102110
}
21112111

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

0 commit comments

Comments
 (0)