/// Information about a dependency requested by a Cargo manifest.
/// Cheap to copy.
-#[derive(PartialEq, Eq, Ord, PartialOrd, Clone, Debug)]
+#[derive(PartialEq, Eq, Hash, Ord, PartialOrd, Clone, Debug)]
pub struct Dependency {
inner: Rc<Inner>,
}
/// The data underlying a Dependency.
-#[derive(PartialEq, Eq, Ord, PartialOrd, Clone, Debug)]
+#[derive(PartialEq, Eq, Hash, Ord, PartialOrd, Clone, Debug)]
struct Inner {
name: String,
source_id: SourceId,
platform: Option<Platform>,
}
-#[derive(Eq, PartialEq, Ord, PartialOrd, Clone, Debug)]
+#[derive(Eq, PartialEq, Hash, Ord, PartialOrd, Clone, Debug)]
pub enum Platform {
Name(String),
Cfg(CfgExpr),
}
}
-#[derive(PartialEq, Eq, Ord, PartialOrd, Clone, Debug, Copy)]
+#[derive(PartialEq, Eq, Hash, Ord, PartialOrd, Clone, Debug, Copy)]
pub enum Kind {
Normal,
Development,
registry: &'a mut (Registry + 'a),
replacements: &'a [(PackageIdSpec, Dependency)],
// TODO: with nll the Rc can be removed
- cache: BTreeMap<Dependency, Rc<Vec<Candidate>>>,
+ cache: HashMap<Dependency, Rc<Vec<Candidate>>>,
}
impl<'a> RegistryQueryer<'a> {
RegistryQueryer {
registry,
replacements,
- cache: BTreeMap::new(),
+ cache: HashMap::new(),
}
}
use util::{CargoError, CargoResult};
-#[derive(Eq, PartialEq, Ord, PartialOrd, Clone, Debug)]
+#[derive(Eq, PartialEq, Hash, Ord, PartialOrd, Clone, Debug)]
pub enum Cfg {
Name(String),
KeyPair(String, String),
}
-#[derive(Eq, PartialEq, Ord, PartialOrd, Clone, Debug)]
+#[derive(Eq, PartialEq, Hash, Ord, PartialOrd, Clone, Debug)]
pub enum CfgExpr {
Not(Box<CfgExpr>),
All(Vec<CfgExpr>),