From fb3122e83e1c6a0eb4b3be6e9eb481c81fa16c18 Mon Sep 17 00:00:00 2001 From: usamoi Date: Wed, 18 Dec 2024 19:49:24 +0800 Subject: [PATCH] make clippy happy --- src/error.rs | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/error.rs b/src/error.rs index 5804bd7a..0a5f992a 100644 --- a/src/error.rs +++ b/src/error.rs @@ -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::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.