From 43f9e6edafb6b65ea77437825e551ba905a31e9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2=20=5BArtyom=20Pavlov=5D?= Date: Wed, 18 Dec 2024 16:19:43 +0300 Subject: [PATCH] Fix compilation error --- src/error.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/error.rs b/src/error.rs index 629a40bd..7328506f 100644 --- a/src/error.rs +++ b/src/error.rs @@ -80,14 +80,11 @@ impl Error { pub fn raw_os_error(self) -> Option { let code = self.0.get(); if code < Self::INTERNAL_START { - RawOsError::try_from(code).ok().map(|errno| { - // On SOLID, negate the error code again to obtain the original error code. - if cfg!(target_os = "solid_asp3") { - -errno - } else { - errno - } - }) + 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 }