Skip to content

Commit a7a28d7

Browse files
committed
Clarify in docs that BufRead::read_line appends
Multiple people have been suprised by this aspect of read_line's behavior, which is not obvious from the docs.
1 parent 94a9506 commit a7a28d7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/libstd/io/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,8 @@ pub trait BufRead: Read {
592592
read_until(self, byte, buf)
593593
}
594594

595-
/// Read all bytes until a newline byte (the 0xA byte) is reached.
595+
/// Read all bytes until a newline byte (the 0xA byte) is reached, and
596+
/// append them to the provided buffer.
596597
///
597598
/// This function will continue to read (and buffer) bytes from the
598599
/// underlying stream until the newline delimiter (the 0xA byte) or EOF is

0 commit comments

Comments
 (0)