From 61f10783d8a5aa3a9bc8b4df187c19b713ef1a62 Mon Sep 17 00:00:00 2001 From: Brad Clawsie Date: Tue, 3 Nov 2026 10:01:02 -0600 Subject: feat: ex4_3 commit 044d4b3d618cd97bff3e83e769c089382d1fdce5 Author: Brad Clawsie Date: Tue Nov 3 10:00:33 2026 -0600 feat: ex4_3 --- ex4_3/src/main.rs | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 ex4_3/src/main.rs (limited to 'ex4_3/src') diff --git a/ex4_3/src/main.rs b/ex4_3/src/main.rs new file mode 100644 index 0000000..158c1b3 --- /dev/null +++ b/ex4_3/src/main.rs @@ -0,0 +1,34 @@ +use std::cmp::PartialEq; + +struct Ticket { + title: String, + description: String, + status: String, +} + +impl PartialEq for Ticket { + fn eq(&self, other: &Self) -> bool { + self.title == other.title && + self.description == other.description && + self.status == other.status + } +} + +fn main() { + println!("Hello, world!"); +} + +#[cfg(test)] +mod tests { + use crate::*; + + #[test] + fn t0() { + let t = Ticket{ + title: String::from("t"), + description: String::from("d"), + status: String::from("s"), + }; + assert_eq!(t == t, true); + } +} -- cgit v1.2.3