Inline single-use method check_close_tag()
This commit is contained in:
parent
40b47aed37
commit
31c9ce5873
|
@ -119,7 +119,15 @@ impl<'xml> Deserializer<'xml> {
|
|||
let ret = visitor.visit_struct(self)?;
|
||||
|
||||
// Process close tag
|
||||
self.check_close_tag(name)?;
|
||||
let item = match self.parser.next() {
|
||||
Some(item) => item?,
|
||||
None => return Err(Error::MissingTag),
|
||||
};
|
||||
|
||||
match item {
|
||||
XmlRecord::Close(v) if v == name => {}
|
||||
_ => return Err(Error::UnexpectedTag),
|
||||
}
|
||||
|
||||
// Removing parser namespaces
|
||||
let _ = new_parser_namespaces
|
||||
|
@ -202,18 +210,6 @@ impl<'xml> Deserializer<'xml> {
|
|||
None => Err(Error::UnexpectedEndOfStream),
|
||||
}
|
||||
}
|
||||
|
||||
fn check_close_tag(&mut self, name: &str) -> Result<(), Error> {
|
||||
let item = match self.parser.next() {
|
||||
Some(item) => item?,
|
||||
None => return Err(Error::MissingTag),
|
||||
};
|
||||
|
||||
match item {
|
||||
XmlRecord::Close(v) if v == name => Ok(()),
|
||||
_ => Err(Error::UnexpectedTag),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct XmlParser<'xml> {
|
||||
|
|
Loading…
Reference in New Issue