summaryrefslogtreecommitdiff
path: root/rust/src
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2026-03-21 21:12:50 -0700
committerMason Reed <35282038+emesare@users.noreply.github.com>2026-03-24 18:46:48 -0700
commita40a300cce8a798200562e9d4515116360dbd0b1 (patch)
tree2794d39b05b9f9e78872a0e8891f5ed074167d40 /rust/src
parent34e93635fd0df131f92f0dcaa8a061648148e40d (diff)
[Rust] Impl `PartialEq`, `Eq` and `Hash` for `Project`
Diffstat (limited to 'rust/src')
-rw-r--r--rust/src/project.rs17
1 files changed, 16 insertions, 1 deletions
diff --git a/rust/src/project.rs b/rust/src/project.rs
index f2743e80..fc750bcb 100644
--- a/rust/src/project.rs
+++ b/rust/src/project.rs
@@ -3,7 +3,8 @@ pub mod folder;
use std::ffi::c_void;
use std::fmt::Debug;
-use std::path::Path;
+use std::hash::Hash;
+use std::path::{Path, PathBuf};
use std::ptr::{null_mut, NonNull};
use std::time::{Duration, SystemTime, UNIX_EPOCH};
@@ -636,6 +637,20 @@ impl Debug for Project {
}
}
+impl PartialEq for Project {
+ fn eq(&self, other: &Self) -> bool {
+ self.id() == other.id()
+ }
+}
+
+impl Eq for Project {}
+
+impl Hash for Project {
+ fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
+ self.id().hash(state);
+ }
+}
+
impl ToOwned for Project {
type Owned = Ref<Self>;