]> git.lizzy.rs Git - rust.git/commitdiff
derive 'Hash'
authorDaniel Eades <danieleades@hotmail.com>
Fri, 30 Dec 2022 11:14:15 +0000 (11:14 +0000)
committerDaniel Eades <danieleades@hotmail.com>
Fri, 30 Dec 2022 11:14:15 +0000 (11:14 +0000)
crates/vfs/src/lib.rs

index afc9a0fa6fb206b1a0c41024137639f016518697..c61f30387b70c2abc9ba5bb55c04ee4710212e5d 100644 (file)
 /// Handle to a file in [`Vfs`]
 ///
 /// Most functions in rust-analyzer use this when they need to refer to a file.
-#[derive(Copy, Clone, Debug, Ord, PartialOrd, Eq, PartialEq)]
+#[derive(Copy, Clone, Debug, Ord, PartialOrd, Eq, PartialEq, Hash)]
 pub struct FileId(pub u32);
 
 impl stdx::hash::NoHashHashable for FileId {}
-impl std::hash::Hash for FileId {
-    fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
-        self.0.hash(state);
-    }
-}
 
 /// Storage for all files read by rust-analyzer.
 ///