Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clippy fixes #6789

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ env:
RUST_NIGHTLY: nightly-2024-05-05
RUSTFLAGS: -D warnings

# Test FreeBSD in a full VM on cirrus-ci.com. Test the i686 target too, in the
# same VM. The binary will be built in 32-bit mode, but will execute on a
# 64-bit kernel and in a 64-bit environment. Our tests don't execute any of
# Test FreeBSD in a full VM on cirrus-ci.com. Test the i686 target too, in the
# same VM. The binary will be built in 32-bit mode, but will execute on a
# 64-bit kernel and in a 64-bit environment. Our tests don't execute any of
# the system's binaries, so the environment shouldn't matter.
task:
name: FreeBSD 64-bit
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ _Adapted from the [Node.js contributing guide][node]_.

The Tokio GitHub repository has a lot of issues and PRs to keep track of. This
section explains the meaning of various labels, as well as our [GitHub
project][project]. The section is primarily targeted at maintainers. Most
project][project]. The section is primarily targeted at maintainers. Most
contributors aren't able to set these labels.

### Area
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ release. The MSRV history for past minor releases can be found below:
* 1.27 to 1.29 - Rust 1.56
* 1.17 to 1.26 - Rust 1.49
* 1.15 to 1.16 - Rust 1.46
* 1.0 to 1.14 - Rust 1.45
* 1.0 to 1.14 - Rust 1.45

Note that although we try to avoid the situation where a dependency transitively
increases the MSRV of Tokio, we do not guarantee that this does not happen.
Expand Down
8 changes: 4 additions & 4 deletions benches/copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ fn copy_mem_to_mem(c: &mut Criterion) {
};

rt.block_on(task());
})
});
});
}

Expand All @@ -202,7 +202,7 @@ fn copy_mem_to_slow_hdd(c: &mut Criterion) {
};

rt.block_on(task());
})
});
});
}

Expand All @@ -219,7 +219,7 @@ fn copy_chunk_to_mem(c: &mut Criterion) {
};

rt.block_on(task());
})
});
});
}

Expand All @@ -236,7 +236,7 @@ fn copy_chunk_to_slow_hdd(c: &mut Criterion) {
};

rt.block_on(task());
})
});
});
}

Expand Down
4 changes: 2 additions & 2 deletions benches/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fn async_read_codec(c: &mut Criterion) {
};

rt.block_on(task());
})
});
});
}

Expand Down Expand Up @@ -98,7 +98,7 @@ fn sync_read(c: &mut Criterion) {
for _i in 0..BLOCK_COUNT {
file.read_exact(&mut buffer).unwrap();
}
})
});
});
}

Expand Down
8 changes: 4 additions & 4 deletions benches/rt_current_thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fn rt_curr_spawn_many_local(c: &mut Criterion) {
handle.await.unwrap();
}
});
})
});
});
}

Expand All @@ -43,7 +43,7 @@ fn rt_curr_spawn_many_remote_idle(c: &mut Criterion) {
handle.await.unwrap();
}
});
})
});
});
}

Expand All @@ -57,7 +57,7 @@ fn rt_curr_spawn_many_remote_busy(c: &mut Criterion) {
tokio::spawn(async { iter() });
}

iter()
iter();
});

c.bench_function("spawn_many_remote_busy", |b| {
Expand All @@ -71,7 +71,7 @@ fn rt_curr_spawn_many_remote_busy(c: &mut Criterion) {
handle.await.unwrap();
}
});
})
});
});
}

Expand Down
14 changes: 7 additions & 7 deletions benches/rt_multi_threaded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fn rt_multi_spawn_many_local(c: &mut Criterion) {

rx.recv().unwrap();
});
})
});
});
}

Expand All @@ -60,7 +60,7 @@ fn rt_multi_spawn_many_remote_idle(c: &mut Criterion) {
handle.await.unwrap();
}
});
})
});
});
}

Expand Down Expand Up @@ -94,7 +94,7 @@ fn rt_multi_spawn_many_remote_busy1(c: &mut Criterion) {
handle.await.unwrap();
}
});
})
});
});

flag.store(false, Relaxed);
Expand Down Expand Up @@ -137,7 +137,7 @@ fn rt_multi_spawn_many_remote_busy2(c: &mut Criterion) {
handle.await.unwrap();
}
});
})
});
});

flag.store(false, Relaxed);
Expand Down Expand Up @@ -167,7 +167,7 @@ fn rt_multi_yield_many(c: &mut Criterion) {
for _ in 0..TASKS {
rx.recv().unwrap();
}
})
});
});
}

Expand Down Expand Up @@ -212,7 +212,7 @@ fn rt_multi_ping_pong(c: &mut Criterion) {

done_rx.recv().unwrap();
});
})
});
});
}

Expand Down Expand Up @@ -243,7 +243,7 @@ fn rt_multi_chained_spawn(c: &mut Criterion) {

done_rx.recv().unwrap();
});
})
});
});
}

Expand Down
2 changes: 1 addition & 1 deletion benches/signal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ fn many_signals(c: &mut Criterion) {
rx.recv().await.expect("channel closed");
}
});
})
});
});
}

Expand Down
8 changes: 4 additions & 4 deletions benches/spawn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fn basic_scheduler_spawn(c: &mut Criterion) {
let h = tokio::spawn(work());
assert_eq!(h.await.unwrap(), 2);
});
})
});
});
}

Expand All @@ -41,7 +41,7 @@ fn basic_scheduler_spawn10(c: &mut Criterion) {
assert_eq!(handle.await.unwrap(), 2);
}
});
})
});
});
}

Expand All @@ -56,7 +56,7 @@ fn threaded_scheduler_spawn(c: &mut Criterion) {
let h = tokio::spawn(work());
assert_eq!(h.await.unwrap(), 2);
});
})
});
});
}

Expand All @@ -76,7 +76,7 @@ fn threaded_scheduler_spawn10(c: &mut Criterion) {
assert_eq!(handle.await.unwrap(), 2);
}
});
})
});
});
}

Expand Down
4 changes: 2 additions & 2 deletions benches/sync_broadcast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ fn contention_impl<const N_TASKS: usize>(g: &mut BenchmarkGroup<WallTime>) {
}
}
}
})
})
});
});
});
}

Expand Down
46 changes: 23 additions & 23 deletions benches/sync_mpsc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@ fn create_medium<const SIZE: usize>(g: &mut BenchmarkGroup<WallTime>) {
g.bench_function(SIZE.to_string(), |b| {
b.iter(|| {
black_box(&mpsc::channel::<Medium>(SIZE));
})
});
});
}

fn send_data<T: Default, const SIZE: usize>(g: &mut BenchmarkGroup<WallTime>, prefix: &str) {
let rt = rt();

g.bench_function(format!("{}_{}", prefix, SIZE), |b| {
g.bench_function(format!("{prefix}_{SIZE}"), |b| {
b.iter(|| {
let (tx, mut rx) = mpsc::channel::<T>(SIZE);

let _ = rt.block_on(tx.send(T::default()));

rt.block_on(rx.recv()).unwrap();
})
});
});
}

Expand All @@ -68,8 +68,8 @@ fn contention_bounded(g: &mut BenchmarkGroup<WallTime>) {
for _ in 0..1_000 * 5 {
let _ = rx.recv().await;
}
})
})
});
});
});
}

Expand All @@ -95,8 +95,8 @@ fn contention_bounded_recv_many(g: &mut BenchmarkGroup<WallTime>) {
while total < 1_000 * 5 {
total += rx.recv_many(&mut buffer, 5_000).await;
}
})
})
});
});
});
}

Expand All @@ -120,8 +120,8 @@ fn contention_bounded_full(g: &mut BenchmarkGroup<WallTime>) {
for _ in 0..1_000 * 5 {
let _ = rx.recv().await;
}
})
})
});
});
});
}

Expand All @@ -147,8 +147,8 @@ fn contention_bounded_full_recv_many(g: &mut BenchmarkGroup<WallTime>) {
while total < 1_000 * 5 {
total += rx.recv_many(&mut buffer, 5_000).await;
}
})
})
});
});
});
}

Expand All @@ -172,8 +172,8 @@ fn contention_unbounded(g: &mut BenchmarkGroup<WallTime>) {
for _ in 0..1_000 * 5 {
let _ = rx.recv().await;
}
})
})
});
});
});
}

Expand All @@ -199,8 +199,8 @@ fn contention_unbounded_recv_many(g: &mut BenchmarkGroup<WallTime>) {
while total < 1_000 * 5 {
total += rx.recv_many(&mut buffer, 5_000).await;
}
})
})
});
});
});
}

Expand All @@ -219,8 +219,8 @@ fn uncontented_bounded(g: &mut BenchmarkGroup<WallTime>) {
for _ in 0..5_000 {
let _ = rx.recv().await;
}
})
})
});
});
});
}

Expand All @@ -241,8 +241,8 @@ fn uncontented_bounded_recv_many(g: &mut BenchmarkGroup<WallTime>) {
while total < 1_000 * 5 {
total += rx.recv_many(&mut buffer, 5_000).await;
}
})
})
});
});
});
}

Expand All @@ -261,8 +261,8 @@ fn uncontented_unbounded(g: &mut BenchmarkGroup<WallTime>) {
for _ in 0..5_000 {
let _ = rx.recv().await;
}
})
})
});
});
});
}

Expand All @@ -283,8 +283,8 @@ fn uncontented_unbounded_recv_many(g: &mut BenchmarkGroup<WallTime>) {
while total < 1_000 * 5 {
total += rx.recv_many(&mut buffer, 5_000).await;
}
})
})
});
});
});
}

Expand Down
4 changes: 2 additions & 2 deletions benches/sync_mpsc_oneshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ fn request_reply(b: &mut Criterion, rt: Runtime) {
task_tx.send(o_tx).await.unwrap();
let _ = o_rx.await;
}
})
})
});
});
});
}

Expand Down
Loading
Loading