Skip to content

Commit

Permalink
workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
Arlie Davis committed Jun 8, 2024
1 parent bd0f214 commit a4f4b0f
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions crates/libs/result/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,17 @@ impl Error {
}

/// Creates a new `Error` from the Win32 error code returned by `GetLastError()`.
#[cfg(windows)]
pub fn from_win32() -> Self {
Self {
code: HRESULT::from_win32(unsafe { GetLastError() }),
info: None,
#[cfg(windows)]
{
Self {
code: HRESULT::from_win32(unsafe { GetLastError() }),
info: None,
}
}
#[cfg(not(windows))]
{
unimplemented!()
}
}

Expand Down

0 comments on commit a4f4b0f

Please sign in to comment.