-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tzdb::local_tz() function get None ,existing problems tzdb 0.4.1 version #105
Comments
Please verify if let mut s = read_link("/etc/localtime")?
+ .canonicalize()?
.into_os_string() would fix the problem for you. |
Not work: fn main() {
const PREFIX: &str = "/usr/share/zoneinfo/";
let mut s = std::fs::read_link("/etc/localtime").unwrap()
+ .canonicalize().unwrap()
.into_os_string()
.into_string().unwrap();
println!("{:?}",s);
} ~ cargo run
+ thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/main.rs:6:25
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
~ |
Yes, I noticed the problem: The link has to be relative to |
You are right |
Kijewski
added a commit
to Kijewski/iana-time-zone
that referenced
this issue
Aug 11, 2022
Kijewski
added a commit
to Kijewski/iana-time-zone
that referenced
this issue
Aug 11, 2022
Kijewski
added a commit
to Kijewski/iana-time-zone
that referenced
this issue
Aug 11, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ref #101
etc/localtime
pathSo,above code return
Relative path
,not aAbsolute path
. It's seems a bug:https://github.com/strawlab/iana-time-zone/blob/main/src/tz_linux.rs#L18-L29In
iana-time-zone
respsitory not includeRelative path
, May be need fix.recommend link:https://stackoverflow.com/questions/30511331/getting-the-absolute-path-from-a-pathbuf
The text was updated successfully, but these errors were encountered: