Skip to content

Commit

Permalink
Fix tests from the previous commit
Browse files Browse the repository at this point in the history
Fixes:
- struct_::non_closed::missing_field
  • Loading branch information
Mingun committed Jul 24, 2022
1 parent 8f30b87 commit 85a569d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
- [#421]: Fixed unknown bug in serde deserialization of externally tagged enums
when an enum variant represented as a `Text` event (i.e. `<xml>tag</xml>`)
and a document encoding is not an UTF-8
- [#434]: Fixed incorrect error generated in some cases by serde deserializer

### Misc Changes

Expand Down Expand Up @@ -158,6 +159,7 @@
- [#363]: Add tests for `Reader::read_event_impl` to ensure that proper events generated for corresponding inputs
- [#407]: Improved benchmark suite to cover whole-document parsing, escaping and unescaping text
- [#418]: Parameterized macrobenchmarks and comparative benchmarks, added throughput measurements via criterion
- [#434]: Added more tests for serde deserialier

[#8]: https://github.com/Mingun/fast-xml/pull/8
[#9]: https://github.com/Mingun/fast-xml/pull/9
Expand All @@ -178,6 +180,7 @@
[#418]: https://github.com/tafia/quick-xml/pull/418
[#421]: https://github.com/tafia/quick-xml/pull/421
[#423]: https://github.com/tafia/quick-xml/pull/423
[#434]: https://github.com/tafia/quick-xml/pull/434
[#437]: https://github.com/tafia/quick-xml/pull/437

## 0.23.0 -- 2022-05-08
Expand Down
8 changes: 7 additions & 1 deletion src/de/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,13 @@ where
};
key.map(Some)
}
_ => Ok(None),
// Stop iteration after reaching a closing tag
DeEvent::End(e) if e.name() == self.start.name() => Ok(None),
// This is a unmatched closing tag, so the XML is invalid
DeEvent::End(e) => Err(DeError::UnexpectedEnd(e.name().as_ref().to_owned())),
// We cannot get `Eof` legally, because we always inside of the
// opened tag `self.start`
DeEvent::Eof => Err(DeError::UnexpectedEof),
}
}
}
Expand Down

0 comments on commit 85a569d

Please sign in to comment.