Remove tokio_xmpp::ParseError and tokio_xmpp::starttls::ParseError

This commit is contained in:
xmppftw xmppftw 2024-07-31 19:25:09 +02:00 committed by Link Mauve
commit ee3d86ec42
4 changed files with 6 additions and 41 deletions

View file

@ -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<Utf8Error> 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 {