aboutsummaryrefslogtreecommitdiffstats
path: root/src/xml/reader.rs
diff options
context:
space:
mode:
authorEdward Barnard2017-02-22 10:27:48 +0000
committerEdward Barnard2017-02-22 10:27:48 +0000
commit364edcccfa907c0182bf085e1fbc3fc49389c54c (patch)
treede8f784eafa8a687cc3548987f1e7484e9ed7769 /src/xml/reader.rs
parent6955747b8fd89025424c2c3feeb568d8fa08e880 (diff)
downloadrust-plist-364edcccfa907c0182bf085e1fbc3fc49389c54c.tar.bz2
Use builder pattern for xml_rs config structs.
Diffstat (limited to 'src/xml/reader.rs')
-rw-r--r--src/xml/reader.rs15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/xml/reader.rs b/src/xml/reader.rs
index 265ac11..d7ec99e 100644
--- a/src/xml/reader.rs
+++ b/src/xml/reader.rs
@@ -3,7 +3,6 @@ use chrono::format::ParseError as ChronoParseError;
use rustc_serialize::base64::FromBase64;
use std::io::Read;
use std::str::FromStr;
-use std::collections::HashMap;
use xml_rs::reader::{EventReader as XmlEventReader, ParserConfig, XmlEvent};
use {Error, Result, PlistEvent};
@@ -23,14 +22,12 @@ pub struct EventReader<R: Read> {
impl<R: Read> EventReader<R> {
pub fn new(reader: R) -> EventReader<R> {
- let config = ParserConfig {
- trim_whitespace: false,
- whitespace_to_characters: true,
- cdata_to_characters: true,
- ignore_comments: true,
- coalesce_characters: true,
- extra_entities: HashMap::default(),
- };
+ let config = ParserConfig::new()
+ .trim_whitespace(false)
+ .whitespace_to_characters(true)
+ .cdata_to_characters(true)
+ .ignore_comments(true)
+ .coalesce_characters(true);
EventReader {
xml_reader: XmlEventReader::new_with_config(reader, config),