Skip to content

Commit ba3fee6

Browse files
authored
Rollup merge of #69405 - NieDzejkob:docs-readline-appends, r=joshtriplett
docs: Stdin::read_line: mention the appending The fact that `stdin().read_line()` is an [unpleasant](https://twitter.com/Michcioperz/status/1231646797661167617?s=20) [footgun](https://rustbattle.net/battle/straight-finch-8-e4f4). Let's make it clearer in the documentation.
2 parents 1cfb6c2 + b3e0d27 commit ba3fee6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libstd/io/stdio.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ impl Stdin {
302302
StdinLock { inner: self.inner.lock().unwrap_or_else(|e| e.into_inner()) }
303303
}
304304

305-
/// Locks this handle and reads a line of input into the specified buffer.
305+
/// Locks this handle and reads a line of input, appending it to the specified buffer.
306306
///
307307
/// For detailed semantics of this method, see the documentation on
308308
/// [`BufRead::read_line`].

0 commit comments

Comments
 (0)