Skip to content

Commit 75fd425

Browse files
committed
Hide quick_xml::escape::resolve_html5_entity under escape-html feature again
This function has significant influence to the compilation time (10+ seconds or 5x times)
1 parent 5629ac7 commit 75fd425

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Changelog.md

+3
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,14 @@
4848
- `SliceReader::get_ref()`
4949
- `Writer::get_ref()`
5050
- `Writer::new()`
51+
- [#763]: Hide `quick_xml::escape::resolve_html5_entity` under `escape-html` feature again.
52+
This function has significant influence to the compilation time (10+ seconds or 5x times)
5153

5254
[#650]: https://github.com/tafia/quick-xml/issues/650
5355
[#755]: https://github.com/tafia/quick-xml/pull/755
5456
[#758]: https://github.com/tafia/quick-xml/pull/758
5557
[#759]: https://github.com/tafia/quick-xml/pull/759
58+
[#763]: https://github.com/tafia/quick-xml/issues/763
5659

5760

5861
## 0.32.0 -- 2024-06-10

src/escape.rs

+4
Original file line numberDiff line numberDiff line change
@@ -328,10 +328,14 @@ pub const fn resolve_xml_entity(entity: &str) -> Option<&'static str> {
328328
}
329329

330330
/// Resolves all HTML5 entities. For complete list see <https://dev.w3.org/html5/html-author/charref>.
331+
#[cfg(feature = "escape-html")]
331332
pub const fn resolve_html5_entity(entity: &str) -> Option<&'static str> {
332333
// imported from https://dev.w3.org/html5/html-author/charref
333334
// match over strings are not allowed in const functions
334335
//TODO: automate up-to-dating using https://html.spec.whatwg.org/entities.json
336+
//TODO: building this function increases compilation time by 10+ seconds (or 5x times)
337+
// Maybe this is because of very long match
338+
// See https://github.com/tafia/quick-xml/issues/763
335339
let s = match entity.as_bytes() {
336340
b"Tab" => "\u{09}",
337341
b"NewLine" => "\u{0A}",

0 commit comments

Comments
 (0)