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:
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user