From b39f511128529dfe9e3f07f1931a840e1f0e36b3 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Thu, 9 Jun 2022 10:43:56 +0200 Subject: [PATCH] Fix formatting with cargo fmt --- instant-xml/src/lib.rs | 4 ++-- instant-xml/src/parse.rs | 14 ++++++-------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/instant-xml/src/lib.rs b/instant-xml/src/lib.rs index 222475d..5896a24 100644 --- a/instant-xml/src/lib.rs +++ b/instant-xml/src/lib.rs @@ -1,8 +1,8 @@ -use std::fmt; use std::collections::HashMap; +use std::fmt; -pub use xmlparser as xmlparser; use thiserror::Error; +pub use xmlparser; pub use macros::{FromXml, ToXml}; diff --git a/instant-xml/src/parse.rs b/instant-xml/src/parse.rs index d9bf73d..6df1125 100644 --- a/instant-xml/src/parse.rs +++ b/instant-xml/src/parse.rs @@ -1,4 +1,4 @@ -use xmlparser::{Token, ElementEnd}; +use xmlparser::{ElementEnd, Token}; use super::Error; @@ -30,13 +30,11 @@ impl<'a> Parse for Option, xmlparser::Error>> { fn element_end(self, _: Option<&str>, _: &str) -> Result<(), Error> { match self { - Some(Ok(Token::ElementEnd { end, .. })) => { - match end { - ElementEnd::Open => todo!(), - ElementEnd::Close(_, _) => todo!(), - ElementEnd::Empty => return Ok(()), - } - } + Some(Ok(Token::ElementEnd { end, .. })) => match end { + ElementEnd::Open => todo!(), + ElementEnd::Close(_, _) => todo!(), + ElementEnd::Empty => return Ok(()), + }, Some(Ok(_)) => Err(Error::UnexpectedValue), Some(Err(err)) => Err(err.into()), None => Err(Error::UnexpectedEndOfStream),