Skip to content

Commit

Permalink
Move std::rt::io to std::io
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Nov 12, 2013
1 parent 8b4683d commit 49ee492
Show file tree
Hide file tree
Showing 119 changed files with 345 additions and 334 deletions.
4 changes: 2 additions & 2 deletions doc/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -2839,12 +2839,12 @@ you just have to import it with an `use` statement.
For example, it re-exports `println` which is defined in `std::io::println`:

~~~
use puts = std::rt::io::stdio::println;
use puts = std::io::stdio::println;
fn main() {
println("println is imported per default.");
puts("Doesn't hinder you from importing it under an different name yourself.");
::std::rt::io::stdio::println("Or from not using the automatic import.");
::std::io::stdio::println("Or from not using the automatic import.");
}
~~~

Expand Down
2 changes: 1 addition & 1 deletion src/compiletest/compiletest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ extern mod extra;

use std::os;
use std::rt;
use std::rt::io::fs;
use std::io::fs;

use extra::getopts;
use extra::getopts::groups::{optopt, optflag, reqopt};
Expand Down
4 changes: 2 additions & 2 deletions src/compiletest/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::rt::io::buffered::BufferedReader;
use std::rt::io::File;
use std::io::buffered::BufferedReader;
use std::io::File;

pub struct ExpectedError { line: uint, kind: ~str, msg: ~str }

Expand Down
4 changes: 2 additions & 2 deletions src/compiletest/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ pub fn is_test_ignored(config: &config, testfile: &Path) -> bool {
}

fn iter_header(testfile: &Path, it: &fn(&str) -> bool) -> bool {
use std::rt::io::buffered::BufferedReader;
use std::rt::io::File;
use std::io::buffered::BufferedReader;
use std::io::File;

let mut rdr = BufferedReader::new(File::open(testfile).unwrap());
loop {
Expand Down
2 changes: 1 addition & 1 deletion src/compiletest/procsrv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use std::os;
use std::run;
use std::str;
use std::rt::io::process::ProcessExit;
use std::io::process::ProcessExit;

#[cfg(target_os = "win32")]
fn target_env(lib_path: &str, prog: &str) -> ~[(~str,~str)] {
Expand Down
28 changes: 14 additions & 14 deletions src/compiletest/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,30 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use common::mode_run_pass;
use common::mode_run_fail;
use common::config;
use common::mode_compile_fail;
use common::mode_pretty;
use common::config;
use common::mode_run_fail;
use common::mode_run_pass;
use errors;
use header::load_props;
use header::TestProps;
use header::load_props;
use procsrv;
use util;
use util::logv;
use util;

use std::rt::io;
use std::rt::io::fs;
use std::rt::io::File;
use std::rt::io::process;
use std::rt::io::process::ProcessExit;
use std::io::File;
use std::io::fs;
use std::io::net::ip::{Ipv4Addr, SocketAddr};
use std::io::net::tcp;
use std::io::process::ProcessExit;
use std::io::process;
use std::io::timer;
use std::io;
use std::os;
use std::str;
use std::vec;
use std::rt::io::net::tcp;
use std::rt::io::net::ip::{Ipv4Addr, SocketAddr};
use std::task;
use std::rt::io::timer;
use std::vec;

use extra::test::MetricMap;

Expand Down
4 changes: 2 additions & 2 deletions src/etc/combine-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ def scrub(b):
d.write("extern mod extra;\n")
d.write("extern mod run_pass_stage2;\n")
d.write("use run_pass_stage2::*;\n")
d.write("use std::rt::io;\n");
d.write("use std::rt::io::Writer;\n");
d.write("use std::io;\n");
d.write("use std::io::Writer;\n");
d.write("fn main() {\n");
d.write(" let mut out = io::stdout();\n");
i = 0
Expand Down
14 changes: 7 additions & 7 deletions src/libextra/ebml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ pub mod reader {
use std::cast::transmute;
use std::int;
use std::option::{None, Option, Some};
use std::rt::io::extensions::u64_from_be_bytes;
use std::io::extensions::u64_from_be_bytes;

// ebml reading

Expand Down Expand Up @@ -608,10 +608,10 @@ pub mod writer {

use std::cast;
use std::clone::Clone;
use std::rt::io;
use std::rt::io::{Writer, Seek};
use std::rt::io::mem::MemWriter;
use std::rt::io::extensions::u64_to_be_bytes;
use std::io;
use std::io::{Writer, Seek};
use std::io::mem::MemWriter;
use std::io::extensions::u64_to_be_bytes;

// ebml writing
pub struct Encoder {
Expand Down Expand Up @@ -961,8 +961,8 @@ mod tests {
use serialize::Encodable;
use serialize;

use std::rt::io::Decorator;
use std::rt::io::mem::MemWriter;
use std::io::Decorator;
use std::io::mem::MemWriter;
use std::option::{None, Option, Some};

#[test]
Expand Down
4 changes: 2 additions & 2 deletions src/libextra/glob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
*/

use std::{os, path};
use std::rt::io;
use std::rt::io::fs;
use std::io;
use std::io::fs;
use std::path::is_sep;

use sort;
Expand Down
12 changes: 6 additions & 6 deletions src/libextra/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ use std::char;
use std::cast::transmute;
use std::f64;
use std::hashmap::HashMap;
use std::rt::io;
use std::rt::io::Decorator;
use std::rt::io::mem::MemWriter;
use std::io;
use std::io::Decorator;
use std::io::mem::MemWriter;
use std::num;
use std::str;
use std::to_str;
Expand Down Expand Up @@ -1311,7 +1311,7 @@ mod tests {

use super::*;

use std::rt::io;
use std::io;
use serialize::Decodable;
use treemap::TreeMap;

Expand Down Expand Up @@ -1483,8 +1483,8 @@ mod tests {
}
fn with_str_writer(f: &fn(@mut io::Writer)) -> ~str {
use std::rt::io::mem::MemWriter;
use std::rt::io::Decorator;
use std::io::mem::MemWriter;
use std::io::Decorator;
use std::str;
let m = @mut MemWriter::new();
Expand Down
8 changes: 4 additions & 4 deletions src/libextra/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use sort;
use std::cmp;
use std::hashmap;
use std::rt::io;
use std::io;
use std::num;

// NB: this can probably be rewritten in terms of num::Num
Expand Down Expand Up @@ -388,7 +388,7 @@ mod tests {
use stats::Summary;
use stats::write_5_number_summary;
use stats::write_boxplot;
use std::rt::io;
use std::io;
use std::str;

fn check(samples: &[f64], summ: &Summary) {
Expand Down Expand Up @@ -942,8 +942,8 @@ mod tests {
#[test]
fn test_boxplot_nonpositive() {
fn t(s: &Summary, expected: ~str) {
use std::rt::io::mem::MemWriter;
use std::rt::io::Decorator;
use std::io::mem::MemWriter;
use std::io::Decorator;
let mut m = MemWriter::new();
write_boxplot(&mut m as &mut io::Writer, s, 30);
let out = str::from_utf8_owned(m.inner());
Expand Down
4 changes: 2 additions & 2 deletions src/libextra/tempfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
use std::os;
use std::rand::Rng;
use std::rand;
use std::rt::io;
use std::rt::io::fs;
use std::io;
use std::io::fs;

/// A wrapper for a path to temporary directory implementing automatic
/// scope-pased deletion.
Expand Down
2 changes: 1 addition & 1 deletion src/libextra/term.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#[allow(missing_doc)];


use std::rt::io;
use std::io;

#[cfg(not(target_os = "win32"))] use std::os;
#[cfg(not(target_os = "win32"))] use terminfo::*;
Expand Down
2 changes: 1 addition & 1 deletion src/libextra/terminfo/parser/compiled.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

use std::{vec, str};
use std::hashmap::HashMap;
use std::rt::io;
use std::io;
use super::super::TermInfo;

// These are the orders ncurses uses in its compiled format (as of 5.9). Not sure if portable.
Expand Down
4 changes: 2 additions & 2 deletions src/libextra/terminfo/searcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
use std::{os, str};
use std::os::getenv;
use std::rt::io;
use std::rt::io::File;
use std::io;
use std::io::File;

/// Return path to database entry for `term`
pub fn get_dbpath_for_term(term: &str) -> Option<~Path> {
Expand Down
10 changes: 5 additions & 5 deletions src/libextra/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ use treemap::TreeMap;

use std::clone::Clone;
use std::comm::{stream, SharedChan, GenericPort, GenericChan};
use std::rt::io;
use std::rt::io::File;
use std::io;
use std::io::File;
use std::task;
use std::to_str::ToStr;
use std::f64;
Expand Down Expand Up @@ -655,9 +655,9 @@ pub fn run_tests_console(opts: &TestOpts,

#[test]
fn should_sort_failures_before_printing_them() {
use std::rt::io;
use std::rt::io::Decorator;
use std::rt::io::mem::MemWriter;
use std::io;
use std::io::Decorator;
use std::io::mem::MemWriter;
use std::str;
fn dummy() {}

Expand Down
4 changes: 2 additions & 2 deletions src/libextra/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

#[allow(missing_doc)];

use std::rt::io::Reader;
use std::rt::io::mem::BufReader;
use std::io::Reader;
use std::io::mem::BufReader;
use std::num;
use std::str;

Expand Down
4 changes: 2 additions & 2 deletions src/libextra/url.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#[allow(missing_doc)];

use std::rt::io::{Reader, Seek};
use std::rt::io::mem::BufReader;
use std::io::{Reader, Seek};
use std::io::mem::BufReader;
use std::cmp::Eq;
use std::hashmap::HashMap;
use std::to_bytes;
Expand Down
4 changes: 2 additions & 2 deletions src/libextra/uuid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -522,8 +522,8 @@ mod test {
use std::str;
use std::rand;
use std::num::Zero;
use std::rt::io::Decorator;
use std::rt::io::mem::MemWriter;
use std::io::Decorator;
use std::io::mem::MemWriter;

#[test]
fn test_new_nil() {
Expand Down
8 changes: 4 additions & 4 deletions src/libextra/workcache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ use treemap::TreeMap;
use std::cell::Cell;
use std::comm::{PortOne, oneshot};
use std::{str, task};
use std::rt::io;
use std::rt::io::{File, Decorator};
use std::rt::io::mem::MemWriter;
use std::io;
use std::io::{File, Decorator};
use std::io::mem::MemWriter;

/**
*
Expand Down Expand Up @@ -479,7 +479,7 @@ impl<'self, T:Send +
#[test]
fn test() {
use std::{os, run};
use std::rt::io::fs;
use std::io::fs;
use std::str::from_utf8_owned;

// Create a path to a new file 'filename' in the directory in which
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use std::ptr;
use std::run;
use std::str;
use std::vec;
use std::rt::io::fs;
use std::io::fs;
use syntax::abi;
use syntax::ast;
use syntax::ast_map::{path, path_mod, path_name, path_pretty_name};
Expand Down Expand Up @@ -968,7 +968,7 @@ pub fn link_binary(sess: Session,
}

fn is_writeable(p: &Path) -> bool {
use std::rt::io;
use std::io;

!p.exists() ||
(match io::result(|| p.stat()) {
Expand Down
6 changes: 3 additions & 3 deletions src/librustc/driver/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ use util::common::time;
use util::ppaux;

use std::hashmap::{HashMap,HashSet};
use std::rt::io;
use std::rt::io::fs;
use std::rt::io::mem::MemReader;
use std::io;
use std::io::fs;
use std::io::mem::MemReader;
use std::os;
use std::vec;
use extra::getopts::groups::{optopt, optmulti, optflag, optflagopt};
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ use driver::session;
use middle::lint;

use std::comm;
use std::rt::io;
use std::rt::io::Reader;
use std::io;
use std::io::Reader;
use std::num;
use std::os;
use std::result;
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/metadata/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ use middle::astencode::vtable_decoder_helpers;

use std::at_vec;
use std::u64;
use std::rt::io;
use std::rt::io::extensions::u64_from_be_bytes;
use std::io;
use std::io::extensions::u64_from_be_bytes;
use std::option;
use std::str;
use std::vec;
Expand Down
Loading

0 comments on commit 49ee492

Please sign in to comment.