mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
derive 'Hash'
This commit is contained in:
parent
368e0bb32f
commit
56ffe63c3c
1 changed files with 1 additions and 6 deletions
|
@ -84,15 +84,10 @@ pub struct CrateGraph {
|
||||||
arena: NoHashHashMap<CrateId, CrateData>,
|
arena: NoHashHashMap<CrateId, CrateData>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||||
pub struct CrateId(pub u32);
|
pub struct CrateId(pub u32);
|
||||||
|
|
||||||
impl stdx::hash::NoHashHashable for CrateId {}
|
impl stdx::hash::NoHashHashable for CrateId {}
|
||||||
impl std::hash::Hash for CrateId {
|
|
||||||
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
|
|
||||||
self.0.hash(state);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||||
pub struct CrateName(SmolStr);
|
pub struct CrateName(SmolStr);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue