Created
February 2, 2019 16:06
-
-
Save blurbdust/c8369b48943bb7df8927c6787c852909 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::env; | |
fn main() -> std::io::Result<()>{ | |
let together = "Good morning ".to_owned(); | |
print!("{}", together); | |
match env::var("USER") { | |
Ok(val) => print!("{}", val), | |
Err(e) => print!("err: {}", e), | |
} | |
let t = " on ".to_owned(); | |
print!("{}", t); | |
match env::var("HOSTNAME") { | |
Ok(val) => print!("{}", val), | |
Err(e) => print!("err: {}", e), | |
} | |
let tt = ". The current directory is ".to_owned(); | |
print!("{}", tt); | |
let path = env::current_dir()?; | |
print!("{}.", path.display()); | |
Ok(()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment