From bd0f2142f240d01b3ff42b8f186c002fcdeb19d3 Mon Sep 17 00:00:00 2001 From: Arlie Davis Date: Sat, 8 Jun 2024 14:28:12 -0700 Subject: [PATCH] don't use cfg --- crates/libs/result/src/error.rs | 62 +++++++++++---------------------- 1 file changed, 21 insertions(+), 41 deletions(-) diff --git a/crates/libs/result/src/error.rs b/crates/libs/result/src/error.rs index 70faed66e7..b41fedd526 100644 --- a/crates/libs/result/src/error.rs +++ b/crates/libs/result/src/error.rs @@ -2,7 +2,7 @@ use super::*; use crate::HRESULT; use core::ffi::c_void; -#[allow(dead_code)] // for #[cfg(not_yet_stable)] +#[allow(dead_code)] // for cases that are not yet stabilized; see below mod winerror { use crate::HRESULT; @@ -234,57 +234,37 @@ impl From for Error { ErrorKind::PermissionDenied => w32(ERROR_ACCESS_DENIED), ErrorKind::ConnectionRefused => w32(WSAECONNREFUSED), ErrorKind::ConnectionReset => w32(WSAECONNRESET), - #[cfg(not_yet_stable)] - ErrorKind::HostUnreachable => w32(WSAEHOSTUNREACH), - #[cfg(not_yet_stable)] - ErrorKind::NetworkUnreachable => w32(WSAENETUNREACH), + // not yet stable: ErrorKind::HostUnreachable => w32(WSAEHOSTUNREACH), + // not yet stable: ErrorKind::NetworkUnreachable => w32(WSAENETUNREACH), ErrorKind::ConnectionAborted => w32(WSAECONNABORTED), ErrorKind::NotConnected => w32(WSAENOTCONN), ErrorKind::AddrInUse => w32(WSAEADDRINUSE), ErrorKind::AddrNotAvailable => w32(WSAEADDRNOTAVAIL), - #[cfg(not_yet_stable)] - ErrorKind::NetworkDown => w32(WSAENETDOWN), + // not yet stable: ErrorKind::NetworkDown => w32(WSAENETDOWN), ErrorKind::BrokenPipe => w32(ERROR_BROKEN_PIPE), ErrorKind::AlreadyExists => w32(ERROR_ALREADY_EXISTS), ErrorKind::WouldBlock => w32(WSAEWOULDBLOCK), - #[cfg(not_yet_stable)] - ErrorKind::NotADirectory => _, - #[cfg(not_yet_stable)] - ErrorKind::IsADirectory => w32(ERROR_DIRECTORY_NOT_SUPPORTED), - #[cfg(not_yet_stable)] - ErrorKind::DirectoryNotEmpty => w32(ERROR_DIR_NOT_EMPTY), - #[cfg(not_yet_stable)] - ErrorKind::ReadOnlyFilesystem => w32(ERROR_FILE_READ_ONLY), - #[cfg(not_yet_stable)] - ErrorKind::FilesystemLoop => (), - #[cfg(not_yet_stable)] - ErrorKind::StaleNetworkFileHandle => (), + // not yet stable: ErrorKind::NotADirectory => _, + // not yet stable: ErrorKind::IsADirectory => w32(ERROR_DIRECTORY_NOT_SUPPORTED), + // not yet stable: ErrorKind::DirectoryNotEmpty => w32(ERROR_DIR_NOT_EMPTY), + // not yet stable: ErrorKind::ReadOnlyFilesystem => w32(ERROR_FILE_READ_ONLY), + // not yet stable: ErrorKind::FilesystemLoop => (), + // not yet stable: ErrorKind::StaleNetworkFileHandle => (), ErrorKind::InvalidInput => E_INVALIDARG, ErrorKind::InvalidData => w32(ERROR_INVALID_DATA), ErrorKind::TimedOut => w32(ERROR_TIMEOUT), ErrorKind::WriteZero => E_FAIL, - #[cfg(not_yet_stable)] - ErrorKind::StorageFull => w32(ERROR_HANDLE_DISK_FULL), - #[cfg(not_yet_stable)] - ErrorKind::NotSeekable => w32(ERROR_SEEK_ON_DEVICE), - #[cfg(not_yet_stable)] - ErrorKind::FilesystemQuotaExceeded => w32(ERROR_DISK_QUOTA_EXCEEDED), - #[cfg(not_yet_stable)] - ErrorKind::FileTooLarge => _, - #[cfg(not_yet_stable)] - ErrorKind::ResourceBusy => _, - #[cfg(not_yet_stable)] - ErrorKind::ExecutableFileBusy => _, - #[cfg(not_yet_stable)] - ErrorKind::Deadlock => w32(ERROR_POSSIBLE_DEADLOCK), - #[cfg(not_yet_stable)] - ErrorKind::CrossesDevices => _, - #[cfg(not_yet_stable)] - ErrorKind::TooManyLinks => _, - #[cfg(not_yet_stable)] - ErrorKind::InvalidFilename => _, - #[cfg(not_yet_stable)] - ErrorKind::ArgumentListTooLong => _, + // not yet stable: ErrorKind::StorageFull => w32(ERROR_HANDLE_DISK_FULL), + // not yet stable: ErrorKind::NotSeekable => w32(ERROR_SEEK_ON_DEVICE), + // not yet stable: ErrorKind::FilesystemQuotaExceeded => w32(ERROR_DISK_QUOTA_EXCEEDED), + // not yet stable: ErrorKind::FileTooLarge => _, + // not yet stable: ErrorKind::ResourceBusy => _, + // not yet stable: ErrorKind::ExecutableFileBusy => _, + // not yet stable: ErrorKind::Deadlock => w32(ERROR_POSSIBLE_DEADLOCK), + // not yet stable: ErrorKind::CrossesDevices => _, + // not yet stable: ErrorKind::TooManyLinks => _, + // not yet stable: ErrorKind::InvalidFilename => _, + // not yet stable: ErrorKind::ArgumentListTooLong => _, ErrorKind::Interrupted => w32(WSAEINTR), ErrorKind::Unsupported => w32(ERROR_NOT_SUPPORTED), ErrorKind::UnexpectedEof => w32(ERROR_HANDLE_EOF),