Skip to content

Commit f757366

Browse files
committed
Fix the error handling on modern Rust
See rust-lang/rust#79965
1 parent 3a88cd8 commit f757366

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

efivar/src/error.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ fn is_variable_not_found_error(err: &io::Error) -> bool {
3838

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

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

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

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

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

6565
impl Error {
@@ -75,7 +75,7 @@ impl Error {
7575
}
7676

7777
if is_permission_denied_error(&error) {
78-
return Error::PermissionDenied { name }
78+
return Error::PermissionDenied { name };
7979
}
8080

8181
Error::VarUnknownError { name, error }

0 commit comments

Comments
 (0)