diff options
| author | Mason Reed <mason@vector35.com> | 2026-03-21 21:12:43 -0700 |
|---|---|---|
| committer | Mason Reed <35282038+emesare@users.noreply.github.com> | 2026-03-24 18:46:48 -0700 |
| commit | 34e93635fd0df131f92f0dcaa8a061648148e40d (patch) | |
| tree | 43fe447ff1e26a1ae591f57c6b98edaa9000daaa /rust | |
| parent | 938e9506996df13b3f08419854aa73c7d24f2d44 (diff) | |
[Rust] Impl `PartialEq`, `Eq` and `Hash` for `ProjectFile`
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>; |
