diff options
| author | Daniel Micay <danielmicay@gmail.com> | 2013-01-23 17:06:32 -0500 |
|---|---|---|
| committer | Daniel Micay <danielmicay@gmail.com> | 2013-01-23 18:01:24 -0500 |
| commit | 7f0fa143bc06002d06064795cb92f8e9a4fec007 (patch) | |
| tree | 3ead3d38d26d151bef041bdb9f7b5f6d49ee17cb /src/libstd/json.rs | |
| parent | 591eefd740f7abc42777fa60035682fb1887fb21 (diff) | |
| download | rust-7f0fa143bc06002d06064795cb92f8e9a4fec007.tar.gz rust-7f0fa143bc06002d06064795cb92f8e9a4fec007.zip | |
switch LinearMap to current constructor convention
Diffstat (limited to 'src/libstd/json.rs')
| -rw-r--r-- | src/libstd/json.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/libstd/json.rs b/src/libstd/json.rs index c41a9e89248..a79d245f70c 100644 --- a/src/libstd/json.rs +++ b/src/libstd/json.rs @@ -24,7 +24,7 @@ use core::float; use core::io::{WriterUtil, ReaderUtil}; use core::io; use core::prelude::*; -use core::hashmap::linear; +use core::hashmap::linear::LinearMap; use core::str; use core::to_str; use core::vec; @@ -40,7 +40,7 @@ pub enum Json { } pub type List = ~[Json]; -pub type Object = linear::LinearMap<~str, Json>; +pub type Object = LinearMap<~str, Json>; pub struct Error { line: uint, @@ -671,7 +671,7 @@ priv impl Parser { self.bump(); self.parse_whitespace(); - let mut values = ~linear::LinearMap(); + let mut values = ~LinearMap::new(); if self.ch == '}' { self.bump(); @@ -1175,9 +1175,9 @@ impl <A: ToJson> ~[A]: ToJson { fn to_json() -> Json { List(self.map(|elt| elt.to_json())) } } -impl <A: ToJson Copy> linear::LinearMap<~str, A>: ToJson { +impl <A: ToJson Copy> LinearMap<~str, A>: ToJson { fn to_json() -> Json { - let mut d = linear::LinearMap(); + let mut d = LinearMap::new(); for self.each() |key, value| { d.insert(copy *key, value.to_json()); } @@ -1188,7 +1188,7 @@ impl <A: ToJson Copy> linear::LinearMap<~str, A>: ToJson { /* impl <A: ToJson Copy> @std::map::HashMap<~str, A>: ToJson { fn to_json() -> Json { - let mut d = linear::LinearMap(); + let mut d = LinearMap::new(); for self.each_ref |key, value| { d.insert(copy *key, value.to_json()); } @@ -1223,10 +1223,10 @@ mod tests { use json::*; use core::result; - use core::hashmap::linear; + use core::hashmap::linear::LinearMap; fn mk_object(items: &[(~str, Json)]) -> Json { - let mut d = ~linear::LinearMap(); + let mut d = LinearMap::new(); for items.each |item| { match *item { |
