Skip to content

Commit

Permalink
Implement PartialEq<&str> for EventID
Browse files Browse the repository at this point in the history
This is going to be useful in tests
  • Loading branch information
hillu committed Jan 18, 2024
1 parent 58e3b85 commit 61b4ecf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ impl Serialize for EventID {
}
}

impl PartialEq<str> 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.
///
Expand Down

0 comments on commit 61b4ecf

Please sign in to comment.