diff options
author | Alex Crichton <alex@alexcrichton.com> | 2014-12-20 22:35:14 -0800 |
---|---|---|
committer | Alex Crichton <alex@alexcrichton.com> | 2014-12-20 22:35:30 -0800 |
commit | 95c6161dcec9cdaada7e1507c6e536eeb7623ed4 (patch) | |
tree | 92d2a790b4e5963011c980b15d5d8f2ef4d866d4 /src/serialization.rs | |
parent | 1346affca989975890b3a0d906b54c10c814e156 (diff) | |
download | milf-rs-95c6161dcec9cdaada7e1507c6e536eeb7623ed4.tar.gz milf-rs-95c6161dcec9cdaada7e1507c6e536eeb7623ed4.zip |
Update to rust master
Diffstat (limited to 'src/serialization.rs')
-rw-r--r-- | src/serialization.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/serialization.rs b/src/serialization.rs index 9dc4835..a0eb5c3 100644 --- a/src/serialization.rs +++ b/src/serialization.rs @@ -1,4 +1,4 @@ -use std::collections::TreeMap; +use std::collections::BTreeMap; use std::mem; use std::fmt; use std::error::Error as StdError; @@ -136,7 +136,7 @@ pub fn encode_str<T: serialize::Encodable<Encoder, Error>>(t: &T) -> String { impl Encoder { /// Constructs a new encoder which will emit to the given output stream. pub fn new() -> Encoder { - Encoder { state: Start, toml: TreeMap::new() } + Encoder { state: Start, toml: BTreeMap::new() } } fn emit_value(&mut self, v: Value) -> Result<(), Error> { @@ -812,7 +812,7 @@ impl StdError for Error { #[cfg(test)] mod tests { - use std::collections::{TreeMap, HashSet}; + use std::collections::{BTreeMap, HashSet}; use serialize::{Encodable, Decodable}; use super::{Encoder, Decoder, DecodeError}; @@ -831,7 +831,7 @@ mod tests { }) ); macro_rules! map( ($($k:ident: $v:expr),*) => ({ - let mut _m = TreeMap::new(); + let mut _m = BTreeMap::new(); $(_m.insert(stringify!($k).to_string(), $v);)* _m }) ); @@ -855,7 +855,7 @@ mod tests { assert_eq!(encode!(v), map! { a_b: Integer(2) }); assert_eq!(v, decode!(Table(encode!(v)))); - let mut m = TreeMap::new(); + let mut m = BTreeMap::new(); m.insert("a-b".to_string(), Integer(2)); assert_eq!(v, decode!(Table(encode!(v)))); } @@ -980,13 +980,13 @@ mod tests { fn hashmap() { #[deriving(Encodable, Decodable, PartialEq, Show)] struct Foo { - map: TreeMap<String, int>, + map: BTreeMap<String, int>, set: HashSet<char>, } let v = Foo { map: { - let mut m = TreeMap::new(); + let mut m = BTreeMap::new(); m.insert("foo".to_string(), 10); m.insert("bar".to_string(), 4); m @@ -1180,7 +1180,7 @@ mod tests { #[test] fn unused_fields4() { #[deriving(Encodable, Decodable, PartialEq, Show)] - struct Foo { a: TreeMap<String, String> } + struct Foo { a: BTreeMap<String, String> } let v = Foo { a: map! { a: "foo".to_string() } }; let mut d = Decoder::new(Table(map! { |