add lazy_static

This commit is contained in:
2020-01-30 22:15:35 +08:00
parent 2a21ef5743
commit 3c70fdf3b9
2 changed files with 20 additions and 0 deletions

10
lazy_static/src/main.rs Normal file
View File

@@ -0,0 +1,10 @@
#[macro_use]
extern crate lazy_static;
lazy_static! {
static ref USER_HOME: Option<String> = std::env::var("HOME").ok();
}
fn main() {
println!("User home: {:?}", *USER_HOME);
}