about summary refs log tree commit diff
path: root/src/libstd/io
diff options
context:
space:
mode:
authorBrendan Zabarauskas <bjzaba@yahoo.com.au>2014-01-09 21:06:55 +1100
committerBrendan Zabarauskas <bjzaba@yahoo.com.au>2014-01-11 10:46:00 +1100
commit4fc0452acef1355ba566a30c5bd04ccd3b9acef2 (patch)
treea11738f6d30837655498a8b7d2197bf01452a8f3 /src/libstd/io
parentff7ecca20e116b8365d8095fa9618dc11e54cfbe (diff)
downloadrust-4fc0452acef1355ba566a30c5bd04ccd3b9acef2.tar.gz
rust-4fc0452acef1355ba566a30c5bd04ccd3b9acef2.zip
Remove re-exports of std::io::stdio::{print, println} in the prelude.
The `print!` and `println!` macros are now the preferred method of printing, and so there is no reason to export the `stdio` functions in the prelude. The functions have also been replaced by their macro counterparts in the tutorial and other documentation so that newcomers don't get confused about what they should be using.
Diffstat (limited to 'src/libstd/io')
-rw-r--r--src/libstd/io/mod.rs6
-rw-r--r--src/libstd/io/signal.rs2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs
index 3ab710e9356..2e33bef380c 100644
--- a/src/libstd/io/mod.rs
+++ b/src/libstd/io/mod.rs
@@ -32,7 +32,7 @@ Some examples of obvious things you might want to do
     # let _g = ::std::io::ignore_io_error();
     let mut stdin = BufferedReader::new(stdin());
     for line in stdin.lines() {
-        print(line);
+        print!("{}", line);
     }
     ```
 
@@ -67,7 +67,7 @@ Some examples of obvious things you might want to do
     let path = Path::new("message.txt");
     let mut file = BufferedReader::new(File::open(&path));
     for line in file.lines() {
-        print(line);
+        print!("{}", line);
     }
     ```
 
@@ -204,7 +204,7 @@ io_error::cond.trap(|e: IoError| {
 });
 
 if error.is_some() {
-    println("failed to write my diary");
+    println!("failed to write my diary");
 }
 # ::std::io::fs::unlink(&Path::new("diary.txt"));
 ```
diff --git a/src/libstd/io/signal.rs b/src/libstd/io/signal.rs
index 4cde35796a6..34b4ed5e1ef 100644
--- a/src/libstd/io/signal.rs
+++ b/src/libstd/io/signal.rs
@@ -68,7 +68,7 @@ pub enum Signum {
 /// do spawn {
 ///     loop {
 ///         match listener.port.recv() {
-///             Interrupt => println("Got Interrupt'ed"),
+///             Interrupt => println!("Got Interrupt'ed"),
 ///             _ => (),
 ///         }
 ///     }