introduce global variable
This commit is contained in:
11
src/global/global.rs
Normal file
11
src/global/global.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
use std::sync::Mutex;
|
||||
use lazy_static::lazy_static;
|
||||
|
||||
lazy_static! {
|
||||
pub static ref DIR_PATH: Mutex<Option<String>> = Mutex::new(None);
|
||||
}
|
||||
|
||||
pub fn set_dir_path(path: String) {
|
||||
let mut directory_path = DIR_PATH.lock().unwrap();
|
||||
*directory_path = Some(path);
|
||||
}
|
||||
Reference in New Issue
Block a user