File: settings.rs

package info (click to toggle)
rust-tz-rs 0.7.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 404 kB
  • sloc: sh: 18; makefile: 4
file content (14 lines) | stat: -rw-r--r-- 459 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
fn main() -> Result<(), tz::Error> {
    #[cfg(feature = "std")]
    {
        use tz::TimeZoneSettings;

        const TIME_ZONE_SETTINGS: TimeZoneSettings<'static> =
            TimeZoneSettings::new(&["/usr/share/zoneinfo", "/share/zoneinfo", "/etc/zoneinfo"], |path| Ok(std::fs::read(path)?));

        let time_zone_local = TIME_ZONE_SETTINGS.parse_local()?;
        println!("{:?}", time_zone_local.find_current_local_time_type()?);
    }

    Ok(())
}