diff --git a/crates/ironrdp-error/src/lib.rs b/crates/ironrdp-error/src/lib.rs index 09a44f651..7aae0f79f 100644 --- a/crates/ironrdp-error/src/lib.rs +++ b/crates/ironrdp-error/src/lib.rs @@ -106,21 +106,6 @@ impl Error { } } - pub fn into_other_kind(self) -> Error - where - Kind: Into, - { - Error { - kind: self.kind.into(), - #[cfg(feature = "alloc")] - meta: self.meta, - #[cfg(not(feature = "alloc"))] - context: self.context, - #[cfg(not(feature = "alloc"))] - location: self.location, - } - } - pub fn kind(&self) -> &Kind { &self.kind } diff --git a/crates/ironrdp-session/src/legacy.rs b/crates/ironrdp-session/src/legacy.rs index 44e1399f0..1c755ce75 100644 --- a/crates/ironrdp-session/src/legacy.rs +++ b/crates/ironrdp-session/src/legacy.rs @@ -1,18 +1,5 @@ -use crate::SessionError; - -// FIXME: code should be fixed so that we never need this conversion -// For that, some code from this ironrdp_session::legacy and ironrdp_connector::legacy modules should be moved to ironrdp_pdu itself -impl From for crate::SessionErrorKind { - fn from(value: ironrdp_connector::ConnectorErrorKind) -> Self { - match value { - ironrdp_connector::ConnectorErrorKind::Custom | ironrdp_connector::ConnectorErrorKind::Credssp(_) => { - crate::SessionErrorKind::Custom - } - _ => crate::SessionErrorKind::General, - } - } -} +use crate::{SessionError, SessionErrorExt as _}; pub(crate) fn map_error(error: ironrdp_connector::ConnectorError) -> SessionError { - error.into_other_kind() + SessionError::custom("connector error", error) }