Skip to content

Commit

Permalink
Clarify in docs that BufRead::read_line appends
Browse files Browse the repository at this point in the history
Multiple people have been suprised by this aspect of read_line's behavior,
which is not obvious from the docs.
  • Loading branch information
mbrubeck committed Mar 19, 2015
1 parent 94a9506 commit a7a28d7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/libstd/io/mod.rs
Expand Up @@ -592,7 +592,8 @@ pub trait BufRead: Read {
read_until(self, byte, buf)
}

/// Read all bytes until a newline byte (the 0xA byte) is reached.
/// Read all bytes until a newline byte (the 0xA byte) is reached, and
/// append them to the provided buffer.
///
/// This function will continue to read (and buffer) bytes from the
/// underlying stream until the newline delimiter (the 0xA byte) or EOF is
Expand Down

0 comments on commit a7a28d7

Please sign in to comment.