From a40a300cce8a798200562e9d4515116360dbd0b1 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Sat, 21 Mar 2026 21:12:50 -0700 Subject: [Rust] Impl `PartialEq`, `Eq` and `Hash` for `Project` --- rust/src/project.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'rust/src') 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(&self, state: &mut H) { + self.id().hash(state); + } +} + impl ToOwned for Project { type Owned = Ref; -- cgit v1.3.1