From 84327e455119e6572705a194db46a81c18197eb2 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..41773f8 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. ///