Skip to content

Commit

Permalink
actually return the bool result of peeking
Browse files Browse the repository at this point in the history
  • Loading branch information
glendc committed Mar 8, 2024
1 parent fc7c80e commit 08614b6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/guard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ impl ShutdownGuard {
///
/// Use [`ShutdownGuard::cancelled`] to wait for the cancellation (shutdown) to be requested.
#[inline]
pub fn cancelled_peek(&self) {
self.0.cancelled_peek();
pub fn cancelled_peek(&self) -> bool {
self.0.cancelled_peek()
}

/// Returns a [`crate::sync::JoinHandle`] that can be awaited on
Expand Down Expand Up @@ -207,8 +207,8 @@ impl WeakShutdownGuard {
///
/// Use [`WeakShutdownGuard::cancelled`] to wait for the cancellation (shutdown) to be requested.
#[inline]
pub fn cancelled_peek(&self) {
self.trigger_rx.closed();
pub fn cancelled_peek(&self) -> bool {
self.trigger_rx.closed()
}

/// Returns a Future that gets fulfilled when cancellation (shutdown) is requested.
Expand Down

0 comments on commit 08614b6

Please sign in to comment.