From 61b4ecf4c668077e48a951e42241239cd4003b0a Mon Sep 17 00:00:00 2001 From: Hilko Bengen Date: Thu, 18 Jan 2024 23:19:15 +0100 Subject: [PATCH] Implement PartialEq<&str> for EventID This is going to be useful in tests --- src/types.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/types.rs b/src/types.rs index 93f3006..2e0b924 100644 --- a/src/types.rs +++ b/src/types.rs @@ -113,6 +113,12 @@ impl Serialize for EventID { } } +impl PartialEq for EventID { + fn eq(&self, other: &str) -> bool { + &format!("{self}") == other + } +} + /// The type of an audit message, corresponding to the `type=…` part /// of every _auditd(8)_ log line. ///