Skip to content

Commit 5ee1267

Browse files
author
vsilent
committed
clippy fix
1 parent 400a99f commit 5ee1267

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/database/events.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ impl EventsDb {
5151
pub fn len(&self) -> usize {
5252
self.events.read().unwrap().len()
5353
}
54+
55+
pub fn is_empty(&self) -> bool {
56+
self.events.read().unwrap().is_empty()
57+
}
5458
}
5559

5660
impl Default for EventsDb {
@@ -102,6 +106,8 @@ mod tests {
102106
#[test]
103107
fn test_events_db_filters_events_by_pid() {
104108
let db = EventsDb::new().unwrap();
109+
assert!(db.is_empty());
110+
105111
db.insert(SecurityEvent::Syscall(SyscallEvent::new(
106112
42,
107113
1000,
@@ -128,5 +134,6 @@ mod tests {
128134
assert_eq!(pid_events.len(), 1);
129135
assert_eq!(pid_events[0].pid(), Some(42));
130136
assert_eq!(db.len(), 3);
137+
assert!(!db.is_empty());
131138
}
132139
}

0 commit comments

Comments
 (0)