September 2017 Update

This commit is contained in:
Ingy döt Net 2017-09-23 10:01:46 +02:00
parent bba7bfd280
commit ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions

View file

@ -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);
}