mirror of
https://gitlab.com/xmpp-rs/xmpp-rs.git
synced 2024-07-12 22:21:53 +00:00
parsers: remove now-obsolete JidCodec
This commit is contained in:
parent
298bf006bf
commit
1e3c075fbf
1 changed files with 0 additions and 17 deletions
|
@ -5,8 +5,6 @@
|
||||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
use base64::{engine::general_purpose::STANDARD as Base64Engine, Engine};
|
use base64::{engine::general_purpose::STANDARD as Base64Engine, Engine};
|
||||||
use jid::Jid;
|
|
||||||
use std::str::FromStr;
|
|
||||||
use xso::error::Error;
|
use xso::error::Error;
|
||||||
|
|
||||||
/// A trait for codecs that can decode and encode text nodes.
|
/// A trait for codecs that can decode and encode text nodes.
|
||||||
|
@ -174,21 +172,6 @@ impl Codec for ColonSeparatedHex {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Codec for a JID.
|
|
||||||
pub struct JidCodec;
|
|
||||||
|
|
||||||
impl Codec for JidCodec {
|
|
||||||
type Decoded = Jid;
|
|
||||||
|
|
||||||
fn decode(s: &str) -> Result<Jid, Error> {
|
|
||||||
Jid::from_str(s).map_err(Error::text_parse_error)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn encode(jid: &Jid) -> Option<String> {
|
|
||||||
Some(jid.to_string())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
Loading…
Reference in a new issue