mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-10-01 12:20:39 +00:00
test: fix all clippy lints in tests (#2573)
This commit is contained in:
parent
db0d6d75b3
commit
9264b837d8
@ -12,5 +12,5 @@ jobs:
|
|||||||
cargo clippy --version
|
cargo clippy --version
|
||||||
displayName: Install clippy
|
displayName: Install clippy
|
||||||
- script: |
|
- script: |
|
||||||
cargo clippy --all --all-features
|
cargo clippy --all --all-features --tests
|
||||||
displayName: cargo clippy --all
|
displayName: cargo clippy --all --tests
|
||||||
|
@ -236,7 +236,7 @@ fn close_semaphore_notifies_permit2() {
|
|||||||
#[test]
|
#[test]
|
||||||
fn cancel_acquire_releases_permits() {
|
fn cancel_acquire_releases_permits() {
|
||||||
let s = Semaphore::new(10);
|
let s = Semaphore::new(10);
|
||||||
let _permit1 = s.try_acquire(4).expect("uncontended try_acquire succeeds");
|
s.try_acquire(4).expect("uncontended try_acquire succeeds");
|
||||||
assert_eq!(6, s.available_permits());
|
assert_eq!(6, s.available_permits());
|
||||||
|
|
||||||
let mut acquire = task::spawn(s.acquire(8));
|
let mut acquire = task::spawn(s.acquire(8));
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#![allow(clippy::blacklisted_name)]
|
||||||
use tokio::sync::oneshot;
|
use tokio::sync::oneshot;
|
||||||
use tokio_test::{assert_pending, assert_ready, task};
|
use tokio_test::{assert_pending, assert_ready, task};
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#![allow(clippy::blacklisted_name)]
|
||||||
use tokio::sync::{mpsc, oneshot};
|
use tokio::sync::{mpsc, oneshot};
|
||||||
use tokio::task;
|
use tokio::task;
|
||||||
use tokio_test::{assert_ok, assert_pending, assert_ready};
|
use tokio_test::{assert_ok, assert_pending, assert_ready};
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#![allow(clippy::blacklisted_name)]
|
||||||
use tokio::sync::oneshot;
|
use tokio::sync::oneshot;
|
||||||
use tokio_test::{assert_pending, assert_ready, task};
|
use tokio_test::{assert_pending, assert_ready, task};
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ fn straight_execution() {
|
|||||||
fn readiness() {
|
fn readiness() {
|
||||||
let l = Arc::new(Mutex::new(100));
|
let l = Arc::new(Mutex::new(100));
|
||||||
let mut t1 = spawn(l.clone().lock_owned());
|
let mut t1 = spawn(l.clone().lock_owned());
|
||||||
let mut t2 = spawn(l.clone().lock_owned());
|
let mut t2 = spawn(l.lock_owned());
|
||||||
|
|
||||||
let g = assert_ready!(t1.poll());
|
let g = assert_ready!(t1.poll());
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#![allow(clippy::blacklisted_name)]
|
||||||
#![warn(rust_2018_idioms)]
|
#![warn(rust_2018_idioms)]
|
||||||
#![cfg(feature = "full")]
|
#![cfg(feature = "full")]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user