From ee3d86ec42bb5c61fcf95353054a587af112e430 Mon Sep 17 00:00:00 2001 From: xmppftw Date: Wed, 31 Jul 2024 19:25:09 +0200 Subject: [PATCH] Remove tokio_xmpp::ParseError and tokio_xmpp::starttls::ParseError --- tokio-xmpp/ChangeLog | 5 +++++ tokio-xmpp/src/error.rs | 20 -------------------- tokio-xmpp/src/lib.rs | 2 +- tokio-xmpp/src/starttls/error.rs | 20 -------------------- 4 files changed, 6 insertions(+), 41 deletions(-) diff --git a/tokio-xmpp/ChangeLog b/tokio-xmpp/ChangeLog index b0b53d8b..2710f09c 100644 --- a/tokio-xmpp/ChangeLog +++ b/tokio-xmpp/ChangeLog @@ -1,3 +1,8 @@ +Version NEXT: +XXXX-YY-ZZ RELEASER + * Breaking: + - Remove `tokio_xmpp::ParseError` and `tokio_xmpp::starttls::ParseError` which were never used + Version 4.0.0: 2024-07-26 Maxime “pep” Buquet * Breaking: diff --git a/tokio-xmpp/src/error.rs b/tokio-xmpp/src/error.rs index c0299c40..f5135fe2 100644 --- a/tokio-xmpp/src/error.rs +++ b/tokio-xmpp/src/error.rs @@ -1,5 +1,4 @@ use sasl::client::MechanismError as SaslMechanismError; -use std::borrow::Cow; use std::error::Error as StdError; use std::fmt; use std::io::Error as IoError; @@ -93,25 +92,6 @@ impl From for Error { } } -/// XML parse error wrapper type -#[derive(Debug)] -pub struct ParseError(pub Cow<'static, str>); - -impl StdError for ParseError { - fn description(&self) -> &str { - self.0.as_ref() - } - fn cause(&self) -> Option<&dyn StdError> { - None - } -} - -impl fmt::Display for ParseError { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", self.0) - } -} - /// XMPP protocol-level error #[derive(Debug)] pub enum ProtocolError { diff --git a/tokio-xmpp/src/lib.rs b/tokio-xmpp/src/lib.rs index 165149df..c3ace542 100644 --- a/tokio-xmpp/src/lib.rs +++ b/tokio-xmpp/src/lib.rs @@ -40,7 +40,7 @@ pub use client::{ mod component; pub use crate::component::Component; mod error; -pub use crate::error::{AuthError, Error, ParseError, ProtocolError}; +pub use crate::error::{AuthError, Error, ProtocolError}; // Re-exports pub use minidom; diff --git a/tokio-xmpp/src/starttls/error.rs b/tokio-xmpp/src/starttls/error.rs index b47e8c62..5b447bee 100644 --- a/tokio-xmpp/src/starttls/error.rs +++ b/tokio-xmpp/src/starttls/error.rs @@ -3,7 +3,6 @@ use hickory_resolver::{error::ResolveError, proto::error::ProtoError}; #[cfg(feature = "tls-native")] use native_tls::Error as TlsError; -use std::borrow::Cow; use std::error::Error as StdError; use std::fmt; #[cfg(all(feature = "tls-rust", not(feature = "tls-native")))] @@ -68,25 +67,6 @@ impl From for Error { } } -/// XML parse error wrapper type -#[derive(Debug)] -pub struct ParseError(pub Cow<'static, str>); - -impl StdError for ParseError { - fn description(&self) -> &str { - self.0.as_ref() - } - fn cause(&self) -> Option<&dyn StdError> { - None - } -} - -impl fmt::Display for ParseError { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", self.0) - } -} - /// Error establishing connection #[derive(Debug)] pub enum ConnectorError {