From 3b07f398811b8d0a31fcf650b71b699a486018b4 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Wed, 7 Sep 2022 12:42:51 +0200 Subject: [PATCH] Clarify Node variant name --- instant-xml/src/de.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/instant-xml/src/de.rs b/instant-xml/src/de.rs index b932979..77ba561 100644 --- a/instant-xml/src/de.rs +++ b/instant-xml/src/de.rs @@ -28,7 +28,7 @@ impl<'cx, 'xml> Deserializer<'cx, 'xml> { pub fn take_str(&mut self) -> Result<&'xml str, Error> { let (value, element) = match self.next() { Some(Ok(Node::AttributeValue(s))) => (s, false), - Some(Ok(Node::Element(s))) => (s, true), + Some(Ok(Node::Text(s))) => (s, true), Some(Ok(_)) => return Err(Error::ExpectedScalar), Some(Err(e)) => return Err(e), None => return Ok(""), @@ -278,7 +278,7 @@ impl<'xml> Iterator for Context<'xml> { } } Ok(Token::Text { text }) => { - return Some(Ok(Node::Element(text.as_str()))); + return Some(Ok(Node::Text(text.as_str()))); } Ok(_) => return Some(Err(Error::UnexpectedToken)), Err(e) => return Some(Err(Error::Parse(e))), @@ -295,7 +295,7 @@ pub enum Node<'xml> { prefix: Option<&'xml str>, local: &'xml str, }, - Element(&'xml str), + Text(&'xml str), Open(Element<'xml>), }