fix: compile error on windows
This commit is contained in:
parent
4f2bb47ab4
commit
34f8e9b551
2 changed files with 1 additions and 3 deletions
|
|
@ -1,6 +1,5 @@
|
|||
#![doc = include_str!("../README.md")]
|
||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||
#![forbid(unsafe_code)]
|
||||
#![warn(missing_docs, clippy::todo, clippy::dbg_macro)]
|
||||
|
||||
//! ## Go to
|
||||
|
|
|
|||
|
|
@ -68,7 +68,6 @@ pub fn local_timezone_name() -> Result<String, Error> {
|
|||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
#[allow(unsafe_code)]
|
||||
{
|
||||
unsafe {
|
||||
use windows_sys::Win32::System::Time::GetDynamicTimeZoneInformation;
|
||||
|
|
@ -87,7 +86,7 @@ pub fn local_timezone_name() -> Result<String, Error> {
|
|||
return Err(Error::Other("local timezone could not be read".into()));
|
||||
}
|
||||
return String::from_utf16(&win_name_utf16[..len])
|
||||
.map_err(|_| "local timezone is invalid UTF16".into())?;
|
||||
.map_err(|_| Error::Other("local timezone is invalid UTF16".into()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue