mirror of
https://github.com/Llewellynvdm/exa.git
synced 2025-02-14 16:16:31 +00:00
deconstruct the TZ environment variable instead of unwrapping
This commit is contained in:
parent
e8d69fc5e8
commit
5be0286749
@ -287,11 +287,10 @@ impl Environment {
|
||||
}
|
||||
|
||||
fn determine_time_zone() -> TZResult<TimeZone> {
|
||||
let tz = env::var("TZ");
|
||||
if tz.is_err() {
|
||||
return TimeZone::from_file("/etc/localtime");
|
||||
if let Ok(file) = env::var("TZ") {
|
||||
TimeZone::from_file(format!("/usr/share/zoneinfo/{}", file))
|
||||
} else {
|
||||
return TimeZone::from_file(format!("/usr/share/zoneinfo/{}", tz.unwrap()));
|
||||
TimeZone::from_file("/etc/localtime")
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user