about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorSteve Klabnik <steve@steveklabnik.com>2015-09-30 13:35:33 -0400
committerSteve Klabnik <steve@steveklabnik.com>2015-09-30 13:35:33 -0400
commit367f46d7931db1871c7eb5f6bece64c1f2467b18 (patch)
tree76badbf39bd24f2c3f79fd6443b7ed438acb42cb /src/libstd
parent3e6d7243ae9749eff27fd320cb422e42291e79d4 (diff)
downloadrust-367f46d7931db1871c7eb5f6bece64c1f2467b18.tar.gz
rust-367f46d7931db1871c7eb5f6bece64c1f2467b18.zip
Make note of performance implications of Read
Fixes #28073
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/io/mod.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs
index 54869807cac..a76755dadd3 100644
--- a/src/libstd/io/mod.rs
+++ b/src/libstd/io/mod.rs
@@ -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`: