parsers: remove now-obsolete JidCodec

This commit is contained in:
Jonas Schäfer 2024-07-01 07:31:36 +02:00
parent 298bf006bf
commit 1e3c075fbf

View file

@ -5,8 +5,6 @@
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
use base64::{engine::general_purpose::STANDARD as Base64Engine, Engine};
use jid::Jid;
use std::str::FromStr;
use xso::error::Error;
/// 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)]
mod tests {
use super::*;