Inline single-use method check_close_tag()
This commit is contained in:
parent
2de53e3009
commit
2267863ae7
|
@ -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