enumset fallout
This commit is contained in:
parent
0bd4dc68e6
commit
67d3823fc3
@ -36,6 +36,7 @@ extern crate rustc_llvm;
|
||||
extern crate rustc_back;
|
||||
extern crate serialize;
|
||||
extern crate rbml;
|
||||
extern crate collections;
|
||||
#[phase(plugin, link)] extern crate log;
|
||||
#[phase(plugin, link)] extern crate syntax;
|
||||
|
||||
|
@ -77,7 +77,7 @@ use std::hash::{Hash, sip, Writer};
|
||||
use std::mem;
|
||||
use std::ops;
|
||||
use std::rc::Rc;
|
||||
use std::collections::enum_set::{EnumSet, CLike};
|
||||
use collections::enum_set::{EnumSet, CLike};
|
||||
use std::collections::hash_map::{HashMap, Occupied, Vacant};
|
||||
use syntax::abi;
|
||||
use syntax::ast::{CrateNum, DefId, DUMMY_NODE_ID, Ident, ItemTrait, LOCAL_CRATE};
|
||||
|
@ -472,7 +472,7 @@ fn json_output(krate: clean::Crate, res: Vec<plugins::PluginJson> ,
|
||||
// "crate": { parsed crate ... },
|
||||
// "plugins": { output of plugins ... }
|
||||
// }
|
||||
let mut json = std::collections::TreeMap::new();
|
||||
let mut json = std::collections::BTreeMap::new();
|
||||
json.insert("schema".to_string(), Json::String(SCHEMA_VERSION.to_string()));
|
||||
let plugins_json = res.into_iter()
|
||||
.filter_map(|opt| {
|
||||
|
@ -15,9 +15,8 @@ use std::default::Default;
|
||||
use std::hash::{Hash, Hasher};
|
||||
|
||||
use {Decodable, Encodable, Decoder, Encoder};
|
||||
use std::collections::{DList, RingBuf, BTreeMap, BTreeSet, HashMap, HashSet,
|
||||
TrieMap, TrieSet, VecMap};
|
||||
use std::collections::enum_set::{EnumSet, CLike};
|
||||
use std::collections::{DList, RingBuf, BTreeMap, BTreeSet, HashMap, HashSet, VecMap};
|
||||
use collections::enum_set::{EnumSet, CLike};
|
||||
|
||||
impl<
|
||||
E,
|
||||
@ -98,7 +97,7 @@ impl<
|
||||
K: Decodable<D, E> + PartialEq + Ord,
|
||||
V: Decodable<D, E> + PartialEq
|
||||
> Decodable<D, E> for BTreeMap<K, V> {
|
||||
fn decode(d: &mut D) -> Result<TreeMap<K, V>, E> {
|
||||
fn decode(d: &mut D) -> Result<BTreeMap<K, V>, E> {
|
||||
d.read_map(|d, len| {
|
||||
let mut map = BTreeMap::new();
|
||||
for i in range(0u, len) {
|
||||
@ -133,7 +132,7 @@ impl<
|
||||
D: Decoder<E>,
|
||||
T: Decodable<D, E> + PartialEq + Ord
|
||||
> Decodable<D, E> for BTreeSet<T> {
|
||||
fn decode(d: &mut D) -> Result<TreeSet<T>, E> {
|
||||
fn decode(d: &mut D) -> Result<BTreeSet<T>, E> {
|
||||
d.read_seq(|d, len| {
|
||||
let mut set = BTreeSet::new();
|
||||
for i in range(0u, len) {
|
||||
@ -255,63 +254,6 @@ impl<
|
||||
}
|
||||
}
|
||||
|
||||
impl<
|
||||
E,
|
||||
S: Encoder<E>,
|
||||
V: Encodable<S, E>
|
||||
> Encodable<S, E> for TrieMap<V> {
|
||||
fn encode(&self, e: &mut S) -> Result<(), E> {
|
||||
e.emit_map(self.len(), |e| {
|
||||
for (i, (key, val)) in self.iter().enumerate() {
|
||||
try!(e.emit_map_elt_key(i, |e| key.encode(e)));
|
||||
try!(e.emit_map_elt_val(i, |e| val.encode(e)));
|
||||
}
|
||||
Ok(())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl<
|
||||
E,
|
||||
D: Decoder<E>,
|
||||
V: Decodable<D, E>
|
||||
> Decodable<D, E> for TrieMap<V> {
|
||||
fn decode(d: &mut D) -> Result<TrieMap<V>, E> {
|
||||
d.read_map(|d, len| {
|
||||
let mut map = TrieMap::new();
|
||||
for i in range(0u, len) {
|
||||
let key = try!(d.read_map_elt_key(i, |d| Decodable::decode(d)));
|
||||
let val = try!(d.read_map_elt_val(i, |d| Decodable::decode(d)));
|
||||
map.insert(key, val);
|
||||
}
|
||||
Ok(map)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl<E, S: Encoder<E>> Encodable<S, E> for TrieSet {
|
||||
fn encode(&self, s: &mut S) -> Result<(), E> {
|
||||
s.emit_seq(self.len(), |s| {
|
||||
for (i, e) in self.iter().enumerate() {
|
||||
try!(s.emit_seq_elt(i, |s| e.encode(s)));
|
||||
}
|
||||
Ok(())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl<E, D: Decoder<E>> Decodable<D, E> for TrieSet {
|
||||
fn decode(d: &mut D) -> Result<TrieSet, E> {
|
||||
d.read_seq(|d, len| {
|
||||
let mut set = TrieSet::new();
|
||||
for i in range(0u, len) {
|
||||
set.insert(try!(d.read_seq_elt(i, |d| Decodable::decode(d))));
|
||||
}
|
||||
Ok(set)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl<
|
||||
E,
|
||||
S: Encoder<E>,
|
||||
|
@ -33,6 +33,8 @@ extern crate test;
|
||||
#[phase(plugin, link)]
|
||||
extern crate log;
|
||||
|
||||
extern crate collections;
|
||||
|
||||
pub use self::serialize::{Decoder, Encoder, Decodable, Encodable,
|
||||
DecoderHelpers, EncoderHelpers};
|
||||
|
||||
|
@ -49,7 +49,7 @@ use self::NamePadding::*;
|
||||
use self::OutputLocation::*;
|
||||
|
||||
use std::any::{Any, AnyRefExt};
|
||||
use std::collections::TreeMap;
|
||||
use std::collections::BTreeMap;
|
||||
use stats::Stats;
|
||||
use getopts::{OptGroup, optflag, optopt};
|
||||
use regex::Regex;
|
||||
@ -230,7 +230,7 @@ impl Metric {
|
||||
}
|
||||
|
||||
#[deriving(PartialEq)]
|
||||
pub struct MetricMap(TreeMap<String,Metric>);
|
||||
pub struct MetricMap(BTreeMap<String,Metric>);
|
||||
|
||||
impl Clone for MetricMap {
|
||||
fn clone(&self) -> MetricMap {
|
||||
@ -1191,7 +1191,7 @@ fn calc_result(desc: &TestDesc, task_result: Result<(), Box<Any+Send>>) -> TestR
|
||||
impl MetricMap {
|
||||
|
||||
pub fn new() -> MetricMap {
|
||||
MetricMap(TreeMap::new())
|
||||
MetricMap(BTreeMap::new())
|
||||
}
|
||||
|
||||
/// Load MetricDiff from a file.
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
extern crate collections;
|
||||
|
||||
use self::collections::TreeMap;
|
||||
use self::collections::BTreeMap;
|
||||
use std::option::Option::Some;
|
||||
use std::str::SendStr;
|
||||
use std::string::ToString;
|
||||
|
Loading…
x
Reference in New Issue
Block a user