about summary refs log tree commit diff
path: root/src/libstd/io
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-11-02 08:44:33 -0700
committerGitHub <noreply@github.com>2016-11-02 08:44:33 -0700
commit0ca9967af75f7a279dcf4921f119b2602b41dd71 (patch)
tree19cfc9cd4d8d59b95357fac17c868dd3a6dc07a2 /src/libstd/io
parentacfe959701ce221af37516401726be6d2814cc3f (diff)
parent6135cbc9e2b9a7e62ae274cf57e9921f60f6ec73 (diff)
downloadrust-0ca9967af75f7a279dcf4921f119b2602b41dd71.tar.gz
rust-0ca9967af75f7a279dcf4921f119b2602b41dd71.zip
Auto merge of #36948 - brson:sys, r=brson
More refactoring to obey platform abstraction lint

The most interesting things here are moving `std/sys/common` to `std/sys_common`, and `std/num/{f32,f64}.rs` to `std/{f32,f64}.rs`, and adding more documentation to `std/lib.rs`.

r? @alexcrichton
Diffstat (limited to 'src/libstd/io')
-rw-r--r--src/libstd/io/mod.rs2
-rw-r--r--src/libstd/io/stdio.rs10
2 files changed, 2 insertions, 10 deletions
diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs
index 37c3f70d54d..193f396c0d4 100644
--- a/src/libstd/io/mod.rs
+++ b/src/libstd/io/mod.rs
@@ -289,7 +289,7 @@ mod lazy;
 mod util;
 mod stdio;
 
-const DEFAULT_BUF_SIZE: usize = 8 * 1024;
+const DEFAULT_BUF_SIZE: usize = ::sys_common::io::DEFAULT_BUF_SIZE;
 
 // A few methods below (read_to_string, read_line) will append data into a
 // `String` buffer, but we need to be pretty careful when doing this. The
diff --git a/src/libstd/io/stdio.rs b/src/libstd/io/stdio.rs
index c24ee8ff303..1777b79ea1b 100644
--- a/src/libstd/io/stdio.rs
+++ b/src/libstd/io/stdio.rs
@@ -214,15 +214,7 @@ pub fn stdin() -> Stdin {
             _ => Maybe::Fake
         };
 
-        // The default buffer capacity is 64k, but apparently windows
-        // doesn't like 64k reads on stdin. See #13304 for details, but the
-        // idea is that on windows we use a slightly smaller buffer that's
-        // been seen to be acceptable.
-        Arc::new(Mutex::new(if cfg!(windows) {
-            BufReader::with_capacity(8 * 1024, stdin)
-        } else {
-            BufReader::new(stdin)
-        }))
+        Arc::new(Mutex::new(BufReader::with_capacity(stdio::STDIN_BUF_SIZE, stdin)))
     }
 }