September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
|
|
@ -1,9 +1,8 @@
|
|||
use std::io::{self,Write};
|
||||
|
||||
fn main() {
|
||||
writeln!(&mut io::stderr(), "Goodbye, world!").expect("Could not write to stderr");
|
||||
// writeln! supports formatted strings so the following works as well
|
||||
let goodbye = "Goodbye";
|
||||
let world = "world";
|
||||
writeln!(&mut io::stderr(), "{}, {}!", goodbye, world).expect("Could not write to stderr");
|
||||
use ::std::io::Write;
|
||||
let (stderr, errmsg) = (&mut ::std::io::stderr(), "Error writing to stderr");
|
||||
writeln!(stderr, "Bye, world!").expect(errmsg);
|
||||
|
||||
let (goodbye, world) = ("Goodbye", "world");
|
||||
writeln!(stderr, "{}, {}!", goodbye, world).expect(errmsg);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue