aboutsummaryrefslogtreecommitdiffstats
path: root/src/xml.rs
diff options
context:
space:
mode:
authorEdward Barnard2015-08-10 23:48:12 +0100
committerEdward Barnard2015-08-10 23:48:12 +0100
commite1889668d9e077392d9172691d7530c7b2de5abf (patch)
tree6c305a610dd62f44c8deec29a3e61cc857a4ff9d /src/xml.rs
parent2d549c343a9f07a751e9a7b537c3c2166168ff06 (diff)
downloadrust-plist-e1889668d9e077392d9172691d7530c7b2de5abf.tar.bz2
Add binary plist support
Diffstat (limited to 'src/xml.rs')
-rw-r--r--src/xml.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/xml.rs b/src/xml.rs
index 3c5105d..cb2a339 100644
--- a/src/xml.rs
+++ b/src/xml.rs
@@ -49,7 +49,7 @@ impl<R: Read> Iterator for StreamingParser<R> {
"plist" => (),
"array" => return Some(PlistEvent::StartArray),
"dict" => return Some(PlistEvent::StartDictionary),
- "key" => return Some(self.read_content(|s| PlistEvent::DictionaryKey(s))),
+ "key" => return Some(self.read_content(|s| PlistEvent::StringValue(s))),
"true" => return Some(PlistEvent::BooleanValue(true)),
"false" => return Some(PlistEvent::BooleanValue(false)),
"data" => return Some(self.read_content(|s| {
@@ -114,18 +114,18 @@ mod tests {
let comparison = &[
StartDictionary,
- DictionaryKey("Author".to_owned()),
+ StringValue("Author".to_owned()),
StringValue("William Shakespeare".to_owned()),
- DictionaryKey("Lines".to_owned()),
+ StringValue("Lines".to_owned()),
StartArray,
StringValue("It is a tale told by an idiot,".to_owned()),
StringValue("Full of sound and fury, signifying nothing.".to_owned()),
EndArray,
- DictionaryKey("Birthdate".to_owned()),
+ StringValue("Birthdate".to_owned()),
IntegerValue(1564),
- DictionaryKey("Height".to_owned()),
+ StringValue("Height".to_owned()),
RealValue(1.60),
- DictionaryKey("Data".to_owned()),
+ StringValue("Data".to_owned()),
DataValue(vec![0, 0, 0, 190, 0, 0, 0, 3, 0, 0, 0, 30, 0, 0, 0]),
EndDictionary
];