From 3a6ceeb18f7f2bf6f5c8c647d4f747fdf47bef7b Mon Sep 17 00:00:00 2001 From: Kornel Date: Sun, 1 Jan 2023 18:04:26 +0000 Subject: Document a way to limit read_line length --- library/std/src/io/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'library/std/src') diff --git a/library/std/src/io/mod.rs b/library/std/src/io/mod.rs index 3f940279bf2..de528e85368 100644 --- a/library/std/src/io/mod.rs +++ b/library/std/src/io/mod.rs @@ -2153,10 +2153,11 @@ pub trait BufRead: Read { /// /// This function is blocking and should be used carefully: it is possible for /// an attacker to continuously send bytes without ever sending a newline - /// or EOF. + /// or EOF. You can use [`take`] to limit the maximum number of bytes read. /// /// [`Ok(0)`]: Ok - /// [`clear`]: String:::clear + /// [`clear`]: String::clear + /// [`take`]: crate::io::Read::take /// /// # Errors /// -- cgit 1.4.1-3-g733a5