Skip to content

Commit 85a569d

Browse files
committed
Fix tests from the previous commit
Fixes: - struct_::non_closed::missing_field
1 parent 8f30b87 commit 85a569d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
- [#421]: Fixed unknown bug in serde deserialization of externally tagged enums
5959
when an enum variant represented as a `Text` event (i.e. `<xml>tag</xml>`)
6060
and a document encoding is not an UTF-8
61+
- [#434]: Fixed incorrect error generated in some cases by serde deserializer
6162

6263
### Misc Changes
6364

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

162164
[#8]: https://github.com/Mingun/fast-xml/pull/8
163165
[#9]: https://github.com/Mingun/fast-xml/pull/9
@@ -178,6 +180,7 @@
178180
[#418]: https://github.com/tafia/quick-xml/pull/418
179181
[#421]: https://github.com/tafia/quick-xml/pull/421
180182
[#423]: https://github.com/tafia/quick-xml/pull/423
183+
[#434]: https://github.com/tafia/quick-xml/pull/434
181184
[#437]: https://github.com/tafia/quick-xml/pull/437
182185

183186
## 0.23.0 -- 2022-05-08

src/de/map.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,13 @@ where
298298
};
299299
key.map(Some)
300300
}
301-
_ => Ok(None),
301+
// Stop iteration after reaching a closing tag
302+
DeEvent::End(e) if e.name() == self.start.name() => Ok(None),
303+
// This is a unmatched closing tag, so the XML is invalid
304+
DeEvent::End(e) => Err(DeError::UnexpectedEnd(e.name().as_ref().to_owned())),
305+
// We cannot get `Eof` legally, because we always inside of the
306+
// opened tag `self.start`
307+
DeEvent::Eof => Err(DeError::UnexpectedEof),
302308
}
303309
}
304310
}

0 commit comments

Comments
 (0)