diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2022-03-16 03:34:34 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-16 03:34:34 +0100 |
| commit | 0732ea2f3ed277283972da124d070ba6d4d19d10 (patch) | |
| tree | d4807e7a071cec3cb3204b774224ee27bf31cfc8 | |
| parent | 35bce1120b87dc3a2c668c085922dc457733d63a (diff) | |
| parent | 2c06c861de2f9674719cd1e5eac571efc359d8df (diff) | |
| download | rust-0732ea2f3ed277283972da124d070ba6d4d19d10.tar.gz rust-0732ea2f3ed277283972da124d070ba6d4d19d10.zip | |
Rollup merge of #94957 - iamzhangyong:explanation-read_line, r=Dylan-DPC
Improve the explanation about the behaviour of read_line Close issue like https://github.com/rust-lang/book/issues/2574
| -rw-r--r-- | library/std/src/io/mod.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/library/std/src/io/mod.rs b/library/std/src/io/mod.rs index 6005270a75f..cd2197fca35 100644 --- a/library/std/src/io/mod.rs +++ b/library/std/src/io/mod.rs @@ -2110,7 +2110,8 @@ pub trait BufRead: Read { } /// Read all bytes until a newline (the `0xA` byte) is reached, and append - /// them to the provided buffer. + /// them to the provided buffer. You do not need to clear the buffer before + /// appending. /// /// This function will read bytes from the underlying stream until the /// newline delimiter (the `0xA` byte) or EOF is found. Once found, all bytes |
