From 0f641fdc1afaa4bd519741a31910b5e624e4e5c8 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Tue, 22 Oct 2024 21:50:41 +0200 Subject: [PATCH] Apply clippy suggestions for Rust 1.82 --- instant-xml/src/de.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/instant-xml/src/de.rs b/instant-xml/src/de.rs index 2fabab2..8bbf17f 100644 --- a/instant-xml/src/de.rs +++ b/instant-xml/src/de.rs @@ -349,10 +349,11 @@ impl<'xml> Iterator for Context<'xml> { Ok(Token::Cdata { text, .. }) => { return Some(Ok(Node::Text(Cow::Borrowed(text.as_str())))); } - Ok(Token::Declaration { .. }) => match self.stack.is_empty() { - false => return Some(Err(Error::UnexpectedToken(format!("{token:?}")))), - true => {} - }, + Ok(Token::Declaration { .. }) => { + if !self.stack.is_empty() { + return Some(Err(Error::UnexpectedToken(format!("{token:?}")))); + } + } Ok(Token::Comment { .. }) => continue, Ok(token) => return Some(Err(Error::UnexpectedToken(format!("{token:?}")))), Err(e) => return Some(Err(Error::Parse(e))),