fn find_tz_file(path: impl AsRef<Path>) -> Result<File, Error> {
    // Don't check system timezone directories on non-UNIX platforms
    #[cfg(not(unix))]
    return Ok(File::open(path)?);

    #[cfg(unix)]
    {
        let path = path.as_ref();
        if path.is_absolute() {
            return Ok(File::open(path)?);
        }

        for folder in &ZONE_INFO_DIRECTORIES {
            if let Ok(file) = File::open(PathBuf::from(folder).join(path)) {
                return Ok(file);
            }
        }

        Err(Error::Io(io::ErrorKind::NotFound.into()))
    }
}
/// Open the TZif file corresponding to a TZ string
Open the TZif file corresponding to a TZ string
Open the TZif file corresponding to a TZ string
fn find_tz_file(path: impl AsRef<Path>) -> Result<File, Error> {
    // Don't check system timezone directories on non-UNIX platforms
    #[cfg(not(unix))]
    return Ok(File::open(path)?);
    #[cfg(unix)]
    {
        let path = path.as_ref();
        if path.is_absolute() {
            return Ok(File::open(path)?);
        }
        for folder in &ZONE_INFO_DIRECTORIES {
            if let Ok(file) = File::open(PathBuf::from(folder).join(path)) {
                return Ok(file);
            }
        }
        Err(Error::Io(io::ErrorKind::NotFound.into()))
    }
}
fn find_tz_file ( path : impl AsRef < Path > ) -> Result < File , Error > { // Don't check system timezone directories on non-UNIX platforms # [ cfg ( not ( unix ) ) ] return Ok ( File :: open ( path ) ? ) ; # [ cfg ( unix ) ] { let path = path . as_ref ( ) ; if path . is_absolute ( ) { return Ok ( File :: open ( path ) ? ) ; } for folder in & ZONE_INFO_DIRECTORIES { if let Ok ( file ) = File :: open ( PathBuf :: from ( folder ) . join ( path ) ) { return Ok ( file ) ; } } Err ( Error :: Io ( io :: ErrorKind :: NotFound . into ( ) ) ) } }
Open the TZif file corresponding to a TZ string
Open the TZif file corresponding to a TZ string
path
impl AsRef<Path>
path
impl AsRef<Path>