diff --git a/bench_map.rs b/bench_map.rs index 7eaaf2c7..2a9d6707 100644 --- a/bench_map.rs +++ b/bench_map.rs @@ -1,5 +1,5 @@ use std::fmt::Show; -use collections::HashMap; +use std::collections::HashMap; use test::Bencher; use serialize::{Decoder, Decodable}; @@ -17,8 +17,8 @@ enum Error { ////////////////////////////////////////////////////////////////////////////// mod decoder { - use collections::HashMap; - use collections::hashmap::MoveEntries; + use std::collections::HashMap; + use std::collections::hashmap::MoveEntries; use serialize; use super::{Error, EndOfStream, SyntaxError}; @@ -153,8 +153,8 @@ mod decoder { ////////////////////////////////////////////////////////////////////////////// mod deserializer { - use collections::HashMap; - use collections::hashmap::MoveEntries; + use std::collections::HashMap; + use std::collections::hashmap::MoveEntries; use super::{Error, EndOfStream, SyntaxError}; diff --git a/bench_struct.rs b/bench_struct.rs index 32f2f013..9748c9ab 100644 --- a/bench_struct.rs +++ b/bench_struct.rs @@ -1,4 +1,4 @@ -use collections::HashMap; +use std::collections::HashMap; use test::Bencher; use serialize::{Decoder, Decodable}; @@ -131,7 +131,7 @@ enum Error { } mod decoder { - use collections::HashMap; + use std::collections::HashMap; use serialize::Decoder; use super::{Outer, Inner, Error, SyntaxError}; @@ -348,7 +348,7 @@ mod decoder { ////////////////////////////////////////////////////////////////////////////// mod deserializer { - use collections::HashMap; + use std::collections::HashMap; use super::{Outer, Inner, Error, EndOfStream, SyntaxError}; use de::Deserializer; use de::{Token, Uint, Char, String, Null, TupleStart, StructStart, Str, SeqStart, MapStart, End, Option}; diff --git a/de.rs b/de.rs index a3542881..1c347b92 100644 --- a/de.rs +++ b/de.rs @@ -10,7 +10,7 @@ use std::hash::Hash; use std::num; -use collections::{HashMap, TreeMap}; +use std::collections::{HashMap, TreeMap}; #[deriving(Clone, PartialEq, Show)] pub enum Token { @@ -689,7 +689,7 @@ impl> Deserializable for GatherTokens { #[cfg(test)] mod tests { - use collections::HashMap; + use std::collections::HashMap; use serialize::Decoder; diff --git a/json.rs b/json.rs index 7bf4fe39..ae47c33c 100644 --- a/json.rs +++ b/json.rs @@ -99,12 +99,9 @@ A basic `ToJson` example using a TreeMap of attribute name / attribute value: ```rust -extern crate collections; -extern crate serialize; - +use std::collections::TreeMap; use serialize::json; use serialize::json::ToJson; -use collections::TreeMap; pub struct MyStruct { attr1: u8, @@ -190,12 +187,9 @@ This example use the ToJson impl to deserialize the JSON string. Example of `ToJson` trait implementation for TestStruct1. ```rust -extern crate serialize; -extern crate collections; - +use std::collections::TreeMap; use serialize::json::ToJson; use serialize::{json, Encodable, Decodable}; -use collections::TreeMap; #[deriving(Decodable, Encodable)] // generate Decodable, Encodable impl. pub struct TestStruct1 { @@ -234,6 +228,8 @@ fn main() { */ use std::char; +use std::collections::{Deque, HashMap, RingBuf, TreeMap}; +use std::collections::treemap; use std::f64; use std::fmt; use std::io::MemWriter; @@ -246,8 +242,6 @@ use std::vec::Vec; use std::vec; use de; -use collections::{Deque, HashMap, RingBuf, TreeMap}; -use collections::treemap; use serialize; use serialize::{Encoder, Encodable}; @@ -2567,11 +2561,11 @@ mod tests { use std::fmt::Show; use std::str; - use collections::TreeMap; + use std::collections::TreeMap; macro_rules! treemap { ($($k:expr => $v:expr),*) => ({ - let mut _m = ::collections::TreeMap::new(); + let mut _m = ::std::collections::TreeMap::new(); $(_m.insert($k, $v);)* _m }) @@ -3500,7 +3494,7 @@ mod tests { fn test_encode_hashmap_with_numeric_key() { use std::str::from_utf8; use std::io::MemWriter; - use collections::HashMap; + use std::collections::HashMap; let mut hm: HashMap = HashMap::new(); hm.insert(1, true); let mut mem_buf = MemWriter::new(); @@ -3516,7 +3510,7 @@ mod tests { fn test_prettyencode_hashmap_with_numeric_key() { use std::str::from_utf8; use std::io::MemWriter; - use collections::HashMap; + use std::collections::HashMap; let mut hm: HashMap = HashMap::new(); hm.insert(1, true); let mut mem_buf = MemWriter::new(); @@ -3532,7 +3526,7 @@ mod tests { /* #[test] fn test_hashmap_with_numeric_key_can_handle_double_quote_delimited_key() { - use collections::HashMap; + use std::collections::HashMap; let json_str = "{\"1\":true}"; let map: HashMap = from_str(json_str).unwrap(); let mut m = HashMap::new(); diff --git a/serde.rs b/serde.rs index 3c43405a..433776ac 100644 --- a/serde.rs +++ b/serde.rs @@ -1,7 +1,5 @@ #![feature(macro_rules, phase)] -extern crate collections; - // test harness access #[cfg(test)] extern crate test;