From 115c72e80142404aba1d9c8d21c13c799d4b4a9d Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Thu, 30 Nov 2023 16:01:22 +0100 Subject: [PATCH] code cleanup --- src/flrig.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/flrig.rs b/src/flrig.rs index fab24f9..171037f 100644 --- a/src/flrig.rs +++ b/src/flrig.rs @@ -63,23 +63,21 @@ fn parse_xml(xml: &str) -> String { let mut value = String::new(); loop { - let mut found = false; + let mut _found = false; match reader.read_event() { Err(e) => panic!("Error at position {}: {:?}", reader.buffer_position(), e), - // exits the loop when reaching end of file + Ok(Event::Eof) => break, Ok(Event::Start(e)) => match e.name().as_ref() { - b"value" => found = true, + b"value" => (), //found = true, _ => (), }, Ok(Event::Text(e)) => value = e.unescape().unwrap().to_owned().to_string(), _ => (), } - // if we don't keep a borrow elsewhere, we can clear the buffer to keep memory usage low - //buf.clear(); } value