Skip to content

Commit

Permalink
Fix the error handling on modern Rust
Browse files Browse the repository at this point in the history
  • Loading branch information
MOZGIII committed Dec 25, 2022
1 parent 3a88cd8 commit bf9a8f4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions efivar/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fn is_variable_not_found_error(err: &io::Error) -> bool {

#[cfg(target_os = "windows")]
fn is_variable_not_found_error(err: &io::Error) -> bool {
err.kind() == io::ErrorKind::Other && err.raw_os_error() == Some(203)
err.raw_os_error() == Some(203)
}

#[cfg(not(target_os = "windows"))]
Expand All @@ -49,7 +49,7 @@ fn is_buffer_too_small_error(_err: &io::Error) -> bool {

#[cfg(target_os = "windows")]
fn is_buffer_too_small_error(err: &io::Error) -> bool {
err.kind() == io::ErrorKind::Other && err.raw_os_error() == Some(122)
err.raw_os_error() == Some(122)
}

#[cfg(not(target_os = "windows"))]
Expand All @@ -59,7 +59,7 @@ fn is_permission_denied_error(err: &io::Error) -> bool {

#[cfg(target_os = "windows")]
fn is_permission_denied_error(err: &io::Error) -> bool {
err.kind() == io::ErrorKind::Other && err.raw_os_error() == Some(1314)
err.raw_os_error() == Some(1314)
}

impl Error {
Expand Down

0 comments on commit bf9a8f4

Please sign in to comment.