Skip to content

Commit 09bc37c

Browse files
committed
Auto merge of #13861 - danieleades:derive-hash, r=Veykril
derive 'Hash' clippy doesn't like that `PartialEq` is derived, and `Hash` is manually implemented. This PR resolves that by deriving the `Hash` implementation.
2 parents 20b0ae4 + da7ce6f commit 09bc37c

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

crates/vfs/src/lib.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,10 @@ pub use paths::{AbsPath, AbsPathBuf};
5959
/// Handle to a file in [`Vfs`]
6060
///
6161
/// Most functions in rust-analyzer use this when they need to refer to a file.
62-
#[derive(Copy, Clone, Debug, Ord, PartialOrd, Eq, PartialEq)]
62+
#[derive(Copy, Clone, Debug, Ord, PartialOrd, Eq, PartialEq, Hash)]
6363
pub struct FileId(pub u32);
6464

6565
impl stdx::hash::NoHashHashable for FileId {}
66-
impl std::hash::Hash for FileId {
67-
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
68-
self.0.hash(state);
69-
}
70-
}
7166

7267
/// Storage for all files read by rust-analyzer.
7368
///

0 commit comments

Comments
 (0)