From d8af56941591cf7df44d879f444ccf591443a2f5 Mon Sep 17 00:00:00 2001 From: Mikhail Date: Sun, 5 May 2024 13:17:08 +0200 Subject: [PATCH] Remove unused FromXml trait implementation --- crates/proto-xmpp/src/mam.rs | 38 ++---------------------------------- 1 file changed, 2 insertions(+), 36 deletions(-) diff --git a/crates/proto-xmpp/src/mam.rs b/crates/proto-xmpp/src/mam.rs index 41160d8..63fc39c 100644 --- a/crates/proto-xmpp/src/mam.rs +++ b/crates/proto-xmpp/src/mam.rs @@ -35,44 +35,10 @@ pub struct Set { pub count: Option, } -impl FromXml for Set { - type P = impl Parser>; - - fn parse() -> Self::P { - |(mut namespace, mut event): (ResolveResult<'static>, &'static Event<'static>)| -> Result { - (namespace, event) = yield; - Ok(Set { count: Some(0) }) - } - } -} - -impl FromXmlTag for Set { - const NAME: &'static str = "set"; - const NS: &'static str = "http://jabber.org/protocol/rsm"; -} - -impl FromXml for Fin { - type P = impl Parser>; - - fn parse() -> Self::P { - |(mut namespace, mut event): (ResolveResult<'static>, &'static Event<'static>)| -> Result { - (namespace, event) = yield; - Ok(Fin { - set: Set { count: Some(0) }, - }) - } - } -} - -impl FromXmlTag for Fin { - const NAME: &'static str = "fin"; - const NS: &'static str = RESULT_SET_XMLNS; -} - impl ToXml for Fin { fn serialize(&self, events: &mut Vec>) { - let mut fin_bytes = BytesStart::new(format!(r#"fin xmlns="{}" complete=True"#, Fin::NS)); - let mut set_bytes = BytesStart::new(format!(r#"set xmlns="{}""#, Set::NS)); + let mut fin_bytes = BytesStart::new(format!(r#"fin xmlns="{}" complete=True"#, MAM_XMLNS)); + let mut set_bytes = BytesStart::new(format!(r#"set xmlns="{}""#, RESULT_SET_XMLNS)); events.push(Event::Start(fin_bytes)); events.push(Event::Start(set_bytes));