File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -2137,8 +2137,10 @@ pub trait BufRead: Read {
2137
2137
}
2138
2138
2139
2139
/// Read all bytes until a newline (the `0xA` byte) is reached, and append
2140
- /// them to the provided buffer. You do not need to clear the buffer before
2141
- /// appending.
2140
+ /// them to the provided `String` buffer.
2141
+ ///
2142
+ /// Previous content of the buffer will be preserved. To avoid appending to
2143
+ /// the buffer, you need to [`clear`] it first.
2142
2144
///
2143
2145
/// This function will read bytes from the underlying stream until the
2144
2146
/// newline delimiter (the `0xA` byte) or EOF is found. Once found, all bytes
@@ -2154,6 +2156,7 @@ pub trait BufRead: Read {
2154
2156
/// or EOF.
2155
2157
///
2156
2158
/// [`Ok(0)`]: Ok
2159
+ /// [`clear`]: String:::clear
2157
2160
///
2158
2161
/// # Errors
2159
2162
///
You can’t perform that action at this time.
0 commit comments