Skip to content

Commit 0fbdc89

Browse files
committed
Fix ERROR_FLAG constant
1 parent 6cd3ce1 commit 0fbdc89

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/error.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ cfg_if::cfg_if!(
99
if #[cfg(target_os = "uefi")] {
1010
type RawOsError = usize;
1111
type NonZeroRawOsError = core::num::NonZeroUsize;
12-
const ERROR_FLAG: u64 = 1 << (usize::BITS - 1);
12+
const UEFI_ERROR_FLAG: RawOsError = 1 << (usize::BITS - 1);
1313
} else {
1414
type RawOsError = i32;
1515
type NonZeroRawOsError = core::num::NonZeroI32;
@@ -67,7 +67,7 @@ impl Error {
6767
pub(super) fn from_os_error(code: RawOsError) -> Self {
6868
match NonZeroRawOsError::new(code) {
6969
#[cfg(target_os = "uefi")]
70-
Some(code) if code.get() & ERROR_FLAG != 0 => Self(code),
70+
Some(code) if code.get() & UEFI_ERROR_FLAG != 0 => Self(code),
7171
#[cfg(not(target_os = "uefi"))]
7272
Some(code) if code.get() < 0 => Self(code),
7373
_ => Self::UNEXPECTED,
@@ -91,7 +91,7 @@ impl Error {
9191
let code = self.0.get();
9292
#[cfg(target_os = "uefi")]
9393
{
94-
if code & ERROR_FLAG != 0 {
94+
if code & UEFI_ERROR_FLAG != 0 {
9595
Some(code)
9696
} else {
9797
None

0 commit comments

Comments
 (0)