From 66268e8a8ddcbfdaf14abf4b584ac8241e23cad1 Mon Sep 17 00:00:00 2001 From: Tobias Bucher Date: Tue, 31 Oct 2017 11:04:08 +0100 Subject: [PATCH] Add a hint what `BufRead` functions do on EOF --- src/libstd/io/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index 074ab3ebd8f..e262257077b 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -1410,6 +1410,8 @@ pub trait BufRead: Read { /// /// If successful, this function will return the total number of bytes read. /// + /// An empty buffer returned indicates that the stream has reached EOF. + /// /// # Errors /// /// This function will ignore all instances of [`ErrorKind::Interrupted`] and @@ -1470,6 +1472,8 @@ pub trait BufRead: Read { /// /// If successful, this function will return the total number of bytes read. /// + /// An empty buffer returned indicates that the stream has reached EOF. + /// /// # Errors /// /// This function has the same error semantics as [`read_until`] and will