Fix clippy::redundant_closure warning

This commit is contained in:
Taiki Endo 2021-12-30 09:38:02 +09:00
parent b9ac443e56
commit 2341801cd0
2 changed files with 3 additions and 3 deletions

View File

@ -447,7 +447,7 @@ impl<'a> LocalExecutor<'a> {
/// Returns a reference to the inner executor.
fn inner(&self) -> &Executor<'a> {
self.inner.get_or_init(|| Executor::new())
self.inner.get_or_init(Executor::new)
}
}

View File

@ -11,7 +11,7 @@ use once_cell::sync::Lazy;
#[test]
fn executor_cancels_everything() {
static DROP: AtomicUsize = AtomicUsize::new(0);
static WAKER: Lazy<Mutex<Option<Waker>>> = Lazy::new(|| Default::default());
static WAKER: Lazy<Mutex<Option<Waker>>> = Lazy::new(Default::default);
let ex = Executor::new();
@ -41,7 +41,7 @@ fn executor_cancels_everything() {
#[test]
fn leaked_executor_leaks_everything() {
static DROP: AtomicUsize = AtomicUsize::new(0);
static WAKER: Lazy<Mutex<Option<Waker>>> = Lazy::new(|| Default::default());
static WAKER: Lazy<Mutex<Option<Waker>>> = Lazy::new(Default::default);
let ex = Executor::new();