Fix no_std build
Signed-off-by: John Nunley <dev@notgull.net>
This commit is contained in:
parent
7beb87ae9f
commit
6f0750c523
|
@ -240,11 +240,10 @@ impl<T> List<T> {
|
|||
queue: concurrent_queue::ConcurrentQueue::unbounded(),
|
||||
}
|
||||
}
|
||||
pub fn total_listeners(&self) -> Result<usize, &str> {
|
||||
self.inner
|
||||
.try_lock()
|
||||
.map(|lock| Ok(lock.listeners.len()))
|
||||
.unwrap_or(Err("<locked>"))
|
||||
|
||||
/// Try to get the total number of listeners without blocking.
|
||||
pub(super) fn try_total_listeners(&self) -> Option<usize> {
|
||||
self.inner.try_lock().map(|lock| lock.listeners.len())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ impl<T> List<T> {
|
|||
}
|
||||
|
||||
/// Get the total number of listeners without blocking.
|
||||
pub fn try_total_listeners(&self) -> Option<usize> {
|
||||
pub(crate) fn try_total_listeners(&self) -> Option<usize> {
|
||||
self.0.try_lock().ok().map(|list| list.len)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue