Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions crates/ironrdp-error/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,6 @@ impl<Kind> Error<Kind> {
}
}

pub fn into_other_kind<OtherKind>(self) -> Error<OtherKind>
where
Kind: Into<OtherKind>,
{
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
}
Expand Down
17 changes: 2 additions & 15 deletions crates/ironrdp-session/src/legacy.rs
Original file line number Diff line number Diff line change
@@ -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<ironrdp_connector::ConnectorErrorKind> 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)
}
Loading