Skip to content

Commit ebd1ad3

Browse files
authored
Rollup merge of rust-lang#36851 - tmiasko:fix-read-until-docs, r=bluss
Fix BufRead::read_until documentation. Second paragraph already fully explains what happens when EOF is encountered. The third paragraph (removed one) is spurious and misleading.
2 parents ce8c6f6 + 1e8f692 commit ebd1ad3

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/libstd/io/mod.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,15 +1264,13 @@ pub trait BufRead: Read {
12641264
#[stable(feature = "rust1", since = "1.0.0")]
12651265
fn consume(&mut self, amt: usize);
12661266

1267-
/// Read all bytes into `buf` until the delimiter `byte` is reached.
1267+
/// Read all bytes into `buf` until the delimiter `byte` or EOF is reached.
12681268
///
12691269
/// This function will read bytes from the underlying stream until the
12701270
/// delimiter or EOF is found. Once found, all bytes up to, and including,
12711271
/// the delimiter (if found) will be appended to `buf`.
12721272
///
1273-
/// If this reader is currently at EOF then this function will not modify
1274-
/// `buf` and will return `Ok(n)` where `n` is the number of bytes which
1275-
/// were read.
1273+
/// If successful, this function will return the total number of bytes read.
12761274
///
12771275
/// # Errors
12781276
///
@@ -1315,9 +1313,7 @@ pub trait BufRead: Read {
13151313
/// up to, and including, the delimiter (if found) will be appended to
13161314
/// `buf`.
13171315
///
1318-
/// If this reader is currently at EOF then this function will not modify
1319-
/// `buf` and will return `Ok(n)` where `n` is the number of bytes which
1320-
/// were read.
1316+
/// If successful, this function will return the total number of bytes read.
13211317
///
13221318
/// # Errors
13231319
///

0 commit comments

Comments
 (0)