diff options
Diffstat (limited to 'rust')
| -rw-r--r-- | rust/src/project/file.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/rust/src/project/file.rs b/rust/src/project/file.rs index c3114cd3..22bf9b4b 100644 --- a/rust/src/project/file.rs +++ b/rust/src/project/file.rs @@ -11,6 +11,7 @@ use binaryninjacore_sys::{ BNProjectFileSetFolder, BNProjectFileSetName, }; use std::fmt::Debug; +use std::hash::Hash; use std::path::{Path, PathBuf}; use std::ptr::{null_mut, NonNull}; use std::time::SystemTime; @@ -155,6 +156,20 @@ impl Debug for ProjectFile { unsafe impl Send for ProjectFile {} unsafe impl Sync for ProjectFile {} +impl PartialEq for ProjectFile { + fn eq(&self, other: &Self) -> bool { + self.id() == other.id() + } +} + +impl Eq for ProjectFile {} + +impl Hash for ProjectFile { + fn hash<H: std::hash::Hasher>(&self, state: &mut H) { + self.id().hash(state); + } +} + impl ToOwned for ProjectFile { type Owned = Ref<Self>; |
