forked from lavina/lavina
Remove unused FromXml trait implementation
This commit is contained in:
parent
49ccb586e3
commit
d8af569415
|
@ -35,44 +35,10 @@ pub struct Set {
|
|||
pub count: Option<i32>,
|
||||
}
|
||||
|
||||
impl FromXml for Set {
|
||||
type P = impl Parser<Output = Result<Self>>;
|
||||
|
||||
fn parse() -> Self::P {
|
||||
|(mut namespace, mut event): (ResolveResult<'static>, &'static Event<'static>)| -> Result<Self> {
|
||||
(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<Output = Result<Self>>;
|
||||
|
||||
fn parse() -> Self::P {
|
||||
|(mut namespace, mut event): (ResolveResult<'static>, &'static Event<'static>)| -> Result<Self> {
|
||||
(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<Event<'static>>) {
|
||||
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));
|
||||
|
||||
|
|
Loading…
Reference in New Issue