Skip to content

Commit

Permalink
Apply review suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
newpavlov authored Dec 18, 2024
1 parent 43f9e6e commit 3e86ef6
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,13 @@ impl Error {
#[inline]
pub fn raw_os_error(self) -> Option<RawOsError> {
let code = self.0.get();
if code < Self::INTERNAL_START {
let res = RawOsError::try_from(code).ok();
// On SOLID, negate the error code again to obtain the original error code.
#[cfg(target_os = "solid_asp3")]
let res = res.map(|errno| -errno);
res
} else {
None
if code >= Self::INTERNAL_START {
return None;
}
let errno = RawOsError::try_from(code).ok()?;
#[cfg(target_os = "solid_asp3")]
let errno = -errno;
Some(errno)
}

/// Creates a new instance of an `Error` from a particular custom error code.
Expand Down

0 comments on commit 3e86ef6

Please sign in to comment.