Skip to content

Commit

Permalink
chore: rename unncancel to finish
Browse files Browse the repository at this point in the history
  • Loading branch information
ShiKaiWi committed Jul 13, 2023
1 parent b497b72 commit f66768f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions common_util/src/future_cancel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ impl<F: FnMut()> FutureCancelGuard<F> {
}
}

/// Set the inner state is uncancelled to ensure the `on_cancel` callback
/// Set the guarded future is finished to ensure the `on_cancel` callback
/// won't be executed.
pub fn uncancel(&mut self) {
pub fn finish(&mut self) {
self.cancelled = false;
}
}
Expand Down Expand Up @@ -73,7 +73,7 @@ mod tests {

// It will be cancelled at this await point.
let _lock_guard = cloned_lock.lock().await;
cancel_guard.uncancel();
cancel_guard.finish();
let mut state = cloned_state.lock().unwrap();
*state = State::Finished;
});
Expand Down

0 comments on commit f66768f

Please sign in to comment.