bench: fix unused_mut lint in benches (#2889)

This commit is contained in:
Mikail Bagishov 2020-09-27 12:07:55 +03:00 committed by GitHub
parent dfdfd61372
commit 99d4061203
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -24,7 +24,7 @@ fn create_100_000_medium(b: &mut Bencher) {
fn send_medium(b: &mut Bencher) {
b.iter(|| {
let (mut tx, mut rx) = mpsc::channel::<Medium>(1000);
let (tx, mut rx) = mpsc::channel::<Medium>(1000);
let _ = tx.try_send([0; 64]);
@ -34,7 +34,7 @@ fn send_medium(b: &mut Bencher) {
fn send_large(b: &mut Bencher) {
b.iter(|| {
let (mut tx, mut rx) = mpsc::channel::<Large>(1000);
let (tx, mut rx) = mpsc::channel::<Large>(1000);
let _ = tx.try_send([[0; 64]; 64]);
@ -54,7 +54,7 @@ fn contention_bounded(b: &mut Bencher) {
let (tx, mut rx) = mpsc::channel::<usize>(1_000_000);
for _ in 0..5 {
let mut tx = tx.clone();
let tx = tx.clone();
tokio::spawn(async move {
for i in 0..1000 {
tx.send(i).await.unwrap();
@ -81,7 +81,7 @@ fn contention_bounded_full(b: &mut Bencher) {
let (tx, mut rx) = mpsc::channel::<usize>(100);
for _ in 0..5 {
let mut tx = tx.clone();
let tx = tx.clone();
tokio::spawn(async move {
for i in 0..1000 {
tx.send(i).await.unwrap();
@ -132,7 +132,7 @@ fn uncontented_bounded(b: &mut Bencher) {
b.iter(|| {
rt.block_on(async move {
let (mut tx, mut rx) = mpsc::channel::<usize>(1_000_000);
let (tx, mut rx) = mpsc::channel::<usize>(1_000_000);
for i in 0..5000 {
tx.send(i).await.unwrap();

View File

@ -53,7 +53,7 @@ fn many_signals(bench: &mut Bencher) {
.unwrap();
let spawn_signal = |kind| {
let mut tx = tx.clone();
let tx = tx.clone();
rt.spawn(async move {
let mut signal = signal(kind).expect("failed to create signal");