]> git.lizzy.rs Git - rust.git/commitdiff
Make note of performance implications of Read
authorSteve Klabnik <steve@steveklabnik.com>
Wed, 30 Sep 2015 17:35:33 +0000 (13:35 -0400)
committerSteve Klabnik <steve@steveklabnik.com>
Wed, 30 Sep 2015 17:35:33 +0000 (13:35 -0400)
Fixes #28073

src/libstd/io/mod.rs

index 54869807cacef4a99a447a4ed7359170dd8bf401..a76755dadd35b188ea2bdb8984b25529705e0cb0 100644 (file)
@@ -370,6 +370,13 @@ fn read_to_end<R: Read + ?Sized>(r: &mut R, buf: &mut Vec<u8>) -> Result<usize>
 /// throughout `std::io` take and provide types which implement the `Read`
 /// trait.
 ///
+/// Please note that each call to `read` may involve a system call, and
+/// therefore, using something that implements [`BufRead`][bufread], such as
+/// [`BufReader`][bufreader], will be more efficient.
+///
+/// [bufread]: trait.BufRead.html
+/// [bufreader]: struct.BufReader.html
+///
 /// # Examples
 ///
 /// [`File`][file]s implement `Read`: