diff --git a/common_util/src/future_cancel.rs b/common_util/src/future_cancel.rs index d7d504b259..efcf31d06f 100644 --- a/common_util/src/future_cancel.rs +++ b/common_util/src/future_cancel.rs @@ -19,9 +19,9 @@ impl FutureCancelGuard { } } - /// 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; } } @@ -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; });