1
0
mirror of https://github.com/jht5945/rust_util.git synced 2025-12-27 15:40:03 +08:00

update get_home(

This commit is contained in:
2019-07-21 21:58:35 +08:00
parent 195c2b1d7d
commit 030f5fbae4

View File

@@ -38,7 +38,10 @@ pub fn is_macos_or_linux() -> bool {
}
pub fn get_home() -> Option<String> {
env::var("HOME").ok()
match is_macos_or_linux() {
true => env::var("HOME").ok(),
false => None,
}
}
pub fn get_absolute_path(path: &str) -> Option<PathBuf> {