Skip to content

Commit 687942e

Browse files
authored
Merge pull request #456 from Mingun/minor-stuff
Make reader and writer modules public, fix a small bug + polishing
2 parents 87d241a + 8644cea commit 687942e

27 files changed

+98
-78
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ async-tokio = ["tokio"]
5959
## [standard compliant]: https://www.w3.org/TR/xml11/#charencoding
6060
encoding = ["encoding_rs"]
6161

62+
## Enables support for recognizing all [HTML 5 entities](https://dev.w3.org/html5/html-author/charref)
63+
escape-html = []
64+
6265
## This feature enables support for deserializing lists where tags are overlapped
6366
## with tags that do not correspond to the list.
6467
##
@@ -108,9 +111,6 @@ overlapped-lists = []
108111
## Enables support for [`serde`] serialization and deserialization
109112
serialize = ["serde"]
110113

111-
## Enables support for recognizing all [HTML 5 entities](https://dev.w3.org/html5/html-author/charref)
112-
escape-html = []
113-
114114
[package.metadata.docs.rs]
115115
# document all features
116116
all-features = true

Changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
and a document encoding is not an UTF-8
6666
- [#434]: Fixed incorrect error generated in some cases by serde deserializer
6767
- [#445]: Use local name without namespace prefix when selecting enum variants based on element names
68+
in a serde deserializer
6869

6970
### Misc Changes
7071

@@ -181,11 +182,15 @@
181182
|`BytesText::from_plain_str(&str)` |_(as above)_
182183
|`BytesCData::new(impl Into<Cow<[u8]>>)` |`BytesCData::new(impl Into<Cow<str>>)`
183184
|`BytesCData::from_str(&str)` |_(as above)_
185+
184186
- [#440]: Removed `Deserializer::from_slice` and `quick_xml::de::from_slice` methods because deserializing from a byte
185187
array cannot guarantee borrowing due to possible copying while decoding.
186188

187189
- [#455]: Removed `Reader::read_text_into` which is only not a better wrapper over match on `Event::Text`
188190

191+
- [#456]: Reader and writer stuff grouped under `reader` and `writer` modules.
192+
You still can use re-exported definitions from a crate root
193+
189194
### New Tests
190195

191196
- [#9]: Added tests for incorrect nested tags in input
@@ -225,8 +230,10 @@
225230
[#439]: https://github.com/tafia/quick-xml/pull/439
226231
[#440]: https://github.com/tafia/quick-xml/pull/440
227232
[#443]: https://github.com/tafia/quick-xml/pull/443
233+
[#445]: https://github.com/tafia/quick-xml/pull/445
228234
[#450]: https://github.com/tafia/quick-xml/pull/450
229235
[#455]: https://github.com/tafia/quick-xml/pull/455
236+
[#456]: https://github.com/tafia/quick-xml/pull/456
230237

231238

232239
## 0.23.0 -- 2022-05-08

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ Syntax is inspired by [xml-rs](https://github.com/netvl/xml-rs).
1919
### Reader
2020

2121
```rust
22-
use quick_xml::Reader;
2322
use quick_xml::events::Event;
23+
use quick_xml::reader::Reader;
2424

2525
let xml = r#"<tag1 att1 = "test">
2626
<tag2><!--Test comment-->Test</tag2>
@@ -66,7 +66,8 @@ loop {
6666

6767
```rust
6868
use quick_xml::events::{Event, BytesEnd, BytesStart};
69-
use quick_xml::{Reader, Writer};
69+
use quick_xml::reader::Reader;
70+
use quick_xml::writer::Writer;
7071
use std::io::Cursor;
7172

7273
let xml = r#"<this_tag k1="v1" k2="v2"><child>text</child></this_tag>"#;

benches/macrobenches.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use criterion::{self, criterion_group, criterion_main, Criterion, Throughput};
22
use quick_xml::events::Event;
3+
use quick_xml::reader::{NsReader, Reader};
34
use quick_xml::Result as XmlResult;
4-
use quick_xml::{NsReader, Reader};
55

66
static RPM_PRIMARY: &str = include_str!("../tests/documents/rpm_primary.xml");
77
static RPM_PRIMARY2: &str = include_str!("../tests/documents/rpm_primary2.xml");

benches/microbenches.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use pretty_assertions::assert_eq;
33
use quick_xml::escape::{escape, unescape};
44
use quick_xml::events::Event;
55
use quick_xml::name::QName;
6-
use quick_xml::{NsReader, Reader};
6+
use quick_xml::reader::{NsReader, Reader};
77

88
static SAMPLE: &str = include_str!("../tests/documents/sample_rss.xml");
99
static PLAYERS: &str = include_str!("../tests/documents/players.xml");

compare/benches/bench.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use criterion::{self, criterion_group, criterion_main, BenchmarkId, Criterion, Throughput};
22
use pretty_assertions::assert_eq;
3-
use quick_xml::{self, events::Event, Reader};
3+
use quick_xml::events::Event;
4+
use quick_xml::reader::Reader;
45
use serde::Deserialize;
56
use serde_xml_rs;
67
use xml::reader::{EventReader, XmlEvent};

examples/custom_entities.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use std::collections::HashMap;
1111

1212
use quick_xml::events::Event;
13-
use quick_xml::Reader;
13+
use quick_xml::reader::Reader;
1414
use regex::bytes::Regex;
1515

1616
const DATA: &str = r#"

examples/nested_readers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use pretty_assertions::assert_eq;
22
use quick_xml::events::Event;
3-
use quick_xml::Reader;
3+
use quick_xml::reader::Reader;
44

55
// a structure to capture the rows we've extracted
66
// from a ECMA-376 table in document.xml

examples/read_buffered.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
fn main() -> Result<(), quick_xml::Error> {
77
use quick_xml::events::Event;
8-
use quick_xml::Reader;
8+
use quick_xml::reader::Reader;
99

1010
let mut reader = Reader::from_file("tests/documents/document.xml")?;
1111
reader.trim_text(true);

examples/read_texts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
fn main() {
22
use quick_xml::events::Event;
3-
use quick_xml::Reader;
3+
use quick_xml::reader::Reader;
44

55
let xml = "<tag1>text1</tag1><tag1>text2</tag1>\
66
<tag1>text3</tag1><tag1><tag2>text4</tag2></tag1>";

0 commit comments

Comments
 (0)