Skip to content

Commit

Permalink
make clippy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
usamoi committed Dec 18, 2024
1 parent 3e3f9f1 commit fb3122e
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,15 @@ impl Error {
/// [1]: https://doc.rust-lang.org/std/io/struct.Error.html#method.raw_os_error
#[inline]
pub fn raw_os_error(self) -> Option<RawOsError> {
RawOsError::try_from(self.0.get()).ok().map(|errno| {
// On SOLID, negate the error code again to obtain the original error code.
#[cfg(target_os = "solid_asp3")]
{
-errno
}
#[cfg(not(target_os = "solid_asp3"))]
{
errno
}
})
#[cfg(not(target_os = "solid_asp3"))]
{
RawOsError::try_from(self.0.get()).ok()
}
// On SOLID, negate the error code again to obtain the original error code.
#[cfg(target_os = "solid_asp3")]
{
RawOsError::try_from(self.0.get()).ok().map(|errno| -errno)
}
}

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

0 comments on commit fb3122e

Please sign in to comment.