From 604a5a20ae0c071389883a012f315e7f0bf94660 Mon Sep 17 00:00:00 2001 From: david Date: Mon, 1 Jul 2024 16:30:43 +0200 Subject: [PATCH] solution to exercise 04_03 --- exercises/04_traits/03_operator_overloading/src/lib.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/exercises/04_traits/03_operator_overloading/src/lib.rs b/exercises/04_traits/03_operator_overloading/src/lib.rs index b75c0f1..4a091d8 100644 --- a/exercises/04_traits/03_operator_overloading/src/lib.rs +++ b/exercises/04_traits/03_operator_overloading/src/lib.rs @@ -8,7 +8,13 @@ struct Ticket { // TODO: Implement the `PartialEq` trait for `Ticket`. -impl PartialEq for Ticket {} +impl PartialEq for Ticket { + fn eq(&self, other: &Self) -> bool { + self.title == other.title + && self.description == other.description + && self.status == other.status + } +} #[cfg(test)] mod tests {