From 0715e6defc4ed358f47654dadaffb3643401ffd8 Mon Sep 17 00:00:00 2001 From: Qi Date: Mon, 12 May 2025 21:18:43 +0800 Subject: [PATCH] time: remove outdated explicitly `drop` call of `Mutex` (#7326) This drop was firstly introduced by [#3289], and the next line invokes `panic!`. In [#5434], the original `panic!` was replaced with `return Err`, so dropping it explicitly is no longer necessary. [#3289]: https://github.com/tokio-rs/tokio/pull/3289 [#5434]: https://github.com/tokio-rs/tokio/pull/5434 --- tokio/src/time/clock.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/tokio/src/time/clock.rs b/tokio/src/time/clock.rs index 50884f972..83b87cac1 100644 --- a/tokio/src/time/clock.rs +++ b/tokio/src/time/clock.rs @@ -251,7 +251,6 @@ cfg_test_util! { let mut inner = self.inner.lock(); if !inner.enable_pausing { - drop(inner); // avoid poisoning the lock return Err("`time::pause()` requires the `current_thread` Tokio runtime. \ This is the default Runtime used by `#[tokio::test]."); }