diff options
| author | Steve Klabnik <steve@steveklabnik.com> | 2016-09-30 13:44:48 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-09-30 13:44:48 -0400 |
| commit | ebd1ad3fbb31a5fcce3de5ed4f02c3c618687f4f (patch) | |
| tree | 3a059cb68f3b02865acfccc7815f6f72e1cc9a4c /src/libstd | |
| parent | ce8c6f6d00858e998e7eeb3e007891d37e141338 (diff) | |
| parent | 1e8f6924613705f6687de3679846b28e8aaa4ba0 (diff) | |
| download | rust-ebd1ad3fbb31a5fcce3de5ed4f02c3c618687f4f.tar.gz rust-ebd1ad3fbb31a5fcce3de5ed4f02c3c618687f4f.zip | |
Rollup merge of #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.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/io/mod.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index 0de02cbf19c..e308a2d8e03 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -1264,15 +1264,13 @@ pub trait BufRead: Read { #[stable(feature = "rust1", since = "1.0.0")] fn consume(&mut self, amt: usize); - /// Read all bytes into `buf` until the delimiter `byte` is reached. + /// Read all bytes into `buf` until the delimiter `byte` or EOF is reached. /// /// This function will read bytes from the underlying stream until the /// delimiter or EOF is found. Once found, all bytes up to, and including, /// the delimiter (if found) will be appended to `buf`. /// - /// If this reader is currently at EOF then this function will not modify - /// `buf` and will return `Ok(n)` where `n` is the number of bytes which - /// were read. + /// If successful, this function will return the total number of bytes read. /// /// # Errors /// @@ -1315,9 +1313,7 @@ pub trait BufRead: Read { /// up to, and including, the delimiter (if found) will be appended to /// `buf`. /// - /// If this reader is currently at EOF then this function will not modify - /// `buf` and will return `Ok(n)` where `n` is the number of bytes which - /// were read. + /// If successful, this function will return the total number of bytes read. /// /// # Errors /// |
