forked from lavina/lavina
Remove excessive and use count
This commit is contained in:
parent
d8af569415
commit
361a8ab192
|
@ -37,14 +37,14 @@ pub struct Set {
|
||||||
|
|
||||||
impl ToXml for Fin {
|
impl ToXml for Fin {
|
||||||
fn serialize(&self, events: &mut Vec<Event<'static>>) {
|
fn serialize(&self, events: &mut Vec<Event<'static>>) {
|
||||||
let mut fin_bytes = BytesStart::new(format!(r#"fin xmlns="{}" complete=True"#, MAM_XMLNS));
|
let 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));
|
let set_bytes = BytesStart::new(format!(r#"set xmlns="{}""#, RESULT_SET_XMLNS));
|
||||||
events.push(Event::Start(fin_bytes));
|
events.push(Event::Start(fin_bytes));
|
||||||
events.push(Event::Start(set_bytes));
|
events.push(Event::Start(set_bytes));
|
||||||
|
|
||||||
if let Some(count) = &self.set.count {
|
if let &Some(count) = &self.set.count {
|
||||||
events.push(Event::Start(BytesStart::new("count")));
|
events.push(Event::Start(BytesStart::new("count")));
|
||||||
events.push(Event::Text(BytesText::new("0")));
|
events.push(Event::Text(BytesText::new(count.to_string().as_str()).into_owned()));
|
||||||
events.push(Event::End(BytesEnd::new("count")));
|
events.push(Event::End(BytesEnd::new("count")));
|
||||||
}
|
}
|
||||||
events.push(Event::End(BytesEnd::new("set")));
|
events.push(Event::End(BytesEnd::new("set")));
|
||||||
|
|
Loading…
Reference in New Issue