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.
This commit is contained in:
parent
ff7ecca20e
commit
4fc0452ace
130 changed files with 350 additions and 336 deletions
|
@ -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"));
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue