auto merge of #11416 : bjz/rust/remove-print-fns, r=alexcrichton
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:
commit
a34727f276
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"));
|
||||
```
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ pub enum Signum {
|
|||
/// do spawn {
|
||||
/// loop {
|
||||
/// match listener.port.recv() {
|
||||
/// Interrupt => println("Got Interrupt'ed"),
|
||||
/// Interrupt => println!("Got Interrupt'ed"),
|
||||
/// _ => (),
|
||||
/// }
|
||||
/// }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue