Skip to content

Commit

Permalink
Removed extra variables from tests that were added to avoid must_use …
Browse files Browse the repository at this point in the history
…warnings
  • Loading branch information
sunjay committed Mar 25, 2021
1 parent 5ce8001 commit caf052c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tokio/tests/sync_mutex.rs
Expand Up @@ -47,7 +47,7 @@ fn readiness() {
// But once g unlocks, we can acquire it
drop(g);
assert!(t2.is_woken());
let _g = assert_ready!(t2.poll());
assert_ready!(t2.poll());
}

/*
Expand Down Expand Up @@ -93,7 +93,7 @@ async fn aborted_future_1() {
timeout(Duration::from_millis(1u64), async move {
let iv = interval(Duration::from_millis(1000));
tokio::pin!(iv);
let _g = m2.lock().await;
m2.lock().await;
iv.as_mut().tick().await;
iv.as_mut().tick().await;
})
Expand All @@ -102,7 +102,7 @@ async fn aborted_future_1() {
}
// This should succeed as there is no lock left for the mutex.
timeout(Duration::from_millis(1u64), async move {
let _g = m1.lock().await;
m1.lock().await;
})
.await
.expect("Mutex is locked");
Expand All @@ -120,15 +120,15 @@ async fn aborted_future_2() {
let m2 = m1.clone();
// Try to lock mutex in a future that is aborted prematurely
timeout(Duration::from_millis(1u64), async move {
let _g = m2.lock().await;
m2.lock().await;
})
.await
.unwrap_err();
}
}
// This should succeed as there is no lock left for the mutex.
timeout(Duration::from_millis(1u64), async move {
let _g = m1.lock().await;
m1.lock().await;
})
.await
.expect("Mutex is locked");
Expand Down

0 comments on commit caf052c

Please sign in to comment.