From 361a8ab192457afc9583c312433cb9d3187573d4 Mon Sep 17 00:00:00 2001 From: Mikhail Date: Sun, 5 May 2024 13:56:05 +0200 Subject: [PATCH] Remove excessive and use count --- crates/proto-xmpp/src/mam.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/proto-xmpp/src/mam.rs b/crates/proto-xmpp/src/mam.rs index 63fc39c..bb157fa 100644 --- a/crates/proto-xmpp/src/mam.rs +++ b/crates/proto-xmpp/src/mam.rs @@ -37,14 +37,14 @@ pub struct Set { impl ToXml for Fin { fn serialize(&self, events: &mut Vec>) { - 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)); + let fin_bytes = BytesStart::new(format!(r#"fin xmlns="{}" complete=True"#, MAM_XMLNS)); + let set_bytes = BytesStart::new(format!(r#"set xmlns="{}""#, RESULT_SET_XMLNS)); events.push(Event::Start(fin_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::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("set")));