summaryrefslogtreecommitdiffstats
path: root/vendor/iana-time-zone/src/tz_freebsd.rs
blob: 4d55e153698e5f0a9083507a3169962682e250e8 (plain)
1
2
3
4
5
6
7
pub(crate) fn get_timezone_inner() -> Result<String, crate::GetTimezoneError> {
    // see https://gitlab.gnome.org/GNOME/evolution-data-server/-/issues/19
    let mut contents = std::fs::read_to_string("/var/db/zoneinfo")?;
    // Trim to the correct length without allocating.
    contents.truncate(contents.trim_end().len());
    Ok(contents)
}