Skip to content

Commit 3a6ceeb

Browse files
committed
Document a way to limit read_line length
1 parent 1a98353 commit 3a6ceeb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

library/std/src/io/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2153,10 +2153,11 @@ pub trait BufRead: Read {
21532153
///
21542154
/// This function is blocking and should be used carefully: it is possible for
21552155
/// an attacker to continuously send bytes without ever sending a newline
2156-
/// or EOF.
2156+
/// or EOF. You can use [`take`] to limit the maximum number of bytes read.
21572157
///
21582158
/// [`Ok(0)`]: Ok
2159-
/// [`clear`]: String:::clear
2159+
/// [`clear`]: String::clear
2160+
/// [`take`]: crate::io::Read::take
21602161
///
21612162
/// # Errors
21622163
///

0 commit comments

Comments
 (0)