Skip to content

Commit

Permalink
[FIX] List struct
Browse files Browse the repository at this point in the history
  • Loading branch information
mamaicode committed Oct 12, 2023
1 parent 5075f46 commit 9ed2090
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,7 @@ impl<T> fmt::Debug for Event<T> {
write!(
f,
"Event {{\n Number of notified listeners: {}\n Total number of listeners: {}\n}}",
notified_count,
total_count
notified_count,total_count
)
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/no_std.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@ impl<T> List<T> {
queue: concurrent_queue::ConcurrentQueue::unbounded(),
}
}
pub fn total_listeners(&self) -> usize {
self.inner.lock().len()
}
}

/// The guard returned by [`Inner::lock`].
Expand Down

0 comments on commit 9ed2090

Please sign in to comment.