Replace TreeMap with BTreeMap in the serde2

This commit is contained in:
Thomas Bahn
2014-12-23 18:33:37 +01:00
parent 7fa62b6212
commit 512a54e983
6 changed files with 27 additions and 27 deletions
+4 -4
View File
@@ -1,4 +1,4 @@
use std::collections::TreeMap;
use std::collections::BTreeMap;
use std::fmt;
use std::io;
@@ -12,7 +12,7 @@ pub enum Value {
F64(f64),
String(String),
Array(Vec<Value>),
Object(TreeMap<String, Value>),
Object(BTreeMap<String, Value>),
}
impl ser::Serialize for Value {
@@ -77,7 +77,7 @@ pub fn to_value<
enum State {
Value(Value),
Array(Vec<Value>),
Object(TreeMap<String, Value>),
Object(BTreeMap<String, Value>),
}
pub struct Writer {
@@ -203,7 +203,7 @@ impl ser::Visitor<Writer, (), ()> for Visitor {
fn visit_map<
V: ser::MapVisitor<Writer, (), ()>
>(&self, state: &mut Writer, mut visitor: V) -> Result<(), ()> {
let values = TreeMap::new();
let values = BTreeMap::new();
state.state.push(State::Object(values));