Replace xml-rs by quick_xml

quick_xml is way faster than xml-rs

Here is an example with a quick atom parser:
    With xml-rs:
        test parse_factorio_atom ... bench:   3,295,678 ns/iter (+/- 165,851)
    With quick_xml:
        test parse_factorio_atom ... bench:     203,215 ns/iter (+/- 13,485)

Unfortunately I had to break the API for this change to happen.
* Element::from_reader now takes `R: BufRead` instead of `R: Read`
* Element::write_to now takes `W: io::Write` instead of `EventWriter<W: Write>`

This migration also allow us to have a write_to function which assumes
we're already in a given namespace (see `write_to_in_namespace`).
This commit is contained in:
Bastien Orivel 2017-06-07 22:40:53 +02:00
commit 9cec9fce9b
5 changed files with 153 additions and 124 deletions

View file

@ -1,8 +1,8 @@
[package]
name = "minidom"
version = "0.4.3"
version = "0.5.0"
authors = ["lumi <lumi@pew.im>", "Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>", "Bastien Orivel <eijebong+minidom@bananium.fr>"]
description = "A small, simple DOM implementation on top of xml-rs."
description = "A small, simple DOM implementation on top of quick-xml"
homepage = "https://gitlab.com/lumi/minidom-rs"
repository = "https://gitlab.com/lumi/minidom-rs"
documentation = "https://docs.rs/minidom"
@ -14,5 +14,5 @@ license = "MIT"
gitlab = { repository = "lumi/minidom-rs" }
[dependencies]
xml-rs = "0.4.1"
quick-xml = "0.7.3"
error-chain = "0.10.0"