Skip to content

Commit 87a287a

Browse files
committed
Fix clippy::uninlined_format_args warning
``` warning: variables can be used directly in the `format!` string --> examples/priority.rs:75:13 | 75 | println!("{:?}", priority); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args = note: `#[warn(clippy::uninlined_format_args)]` on by default help: change this to | 75 - println!("{:?}", priority); 75 + println!("{priority:?}"); | warning: variables can be used directly in the `format!` string --> examples/priority.rs:77:13 | 77 | println!("{:?}", priority); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 77 - println!("{:?}", priority); 77 + println!("{priority:?}"); | warning: variables can be used directly in the `format!` string --> benches/executor.rs:62:34 | 62 | group.bench_function(format!("{}::spawn_one", prefix), |b| { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args = note: `#[warn(clippy::uninlined_format_args)]` on by default help: change this to | 62 - group.bench_function(format!("{}::spawn_one", prefix), |b| { 62 + group.bench_function(format!("{prefix}::spawn_one"), |b| { | warning: variables can be used directly in the `format!` string --> benches/executor.rs:101:34 | 101 | group.bench_function(format!("{}::spawn_many_local", prefix), |b| { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 101 - group.bench_function(format!("{}::spawn_many_local", prefix), |b| { 101 + group.bench_function(format!("{prefix}::spawn_many_local"), |b| { | warning: variables can be used directly in the `format!` string --> benches/executor.rs:139:34 | 139 | group.bench_function(format!("{}::spawn_recursively", prefix), |b| { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 139 - group.bench_function(format!("{}::spawn_recursively", prefix), |b| { 139 + group.bench_function(format!("{prefix}::spawn_recursively"), |b| { | warning: variables can be used directly in the `format!` string --> benches/executor.rs:204:34 | 204 | group.bench_function(format!("{}::yield_now", prefix), |b| { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 204 - group.bench_function(format!("{}::yield_now", prefix), |b| { 204 + group.bench_function(format!("{prefix}::yield_now"), |b| { | warning: variables can be used directly in the `format!` string --> benches/executor.rs:250:34 | 250 | group.bench_function(format!("{}::channels", prefix), |b| { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 250 - group.bench_function(format!("{}::channels", prefix), |b| { 250 + group.bench_function(format!("{prefix}::channels"), |b| { | warning: variables can be used directly in the `format!` string --> benches/executor.rs:328:34 | 328 | group.bench_function(format!("{}::web_server", prefix), |b| { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 328 - group.bench_function(format!("{}::web_server", prefix), |b| { 328 + group.bench_function(format!("{prefix}::web_server"), |b| { | ```
1 parent 3d912bb commit 87a287a

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

benches/executor.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ fn running_benches(c: &mut Criterion) {
5959
for (group_name, multithread) in [("single_thread", false), ("multi_thread", true)].iter() {
6060
let mut group = c.benchmark_group(group_name.to_string());
6161

62-
group.bench_function(format!("{}::spawn_one", prefix), |b| {
62+
group.bench_function(format!("{prefix}::spawn_one"), |b| {
6363
if with_static {
6464
run_static(
6565
|| {
@@ -98,7 +98,7 @@ fn running_benches(c: &mut Criterion) {
9898
});
9999
}
100100

101-
group.bench_function(format!("{}::spawn_many_local", prefix), |b| {
101+
group.bench_function(format!("{prefix}::spawn_many_local"), |b| {
102102
if with_static {
103103
run_static(
104104
|| {
@@ -136,7 +136,7 @@ fn running_benches(c: &mut Criterion) {
136136
}
137137
});
138138

139-
group.bench_function(format!("{}::spawn_recursively", prefix), |b| {
139+
group.bench_function(format!("{prefix}::spawn_recursively"), |b| {
140140
#[allow(clippy::manual_async_fn)]
141141
fn go(i: usize) -> impl Future<Output = ()> + Send + 'static {
142142
async move {
@@ -201,7 +201,7 @@ fn running_benches(c: &mut Criterion) {
201201
}
202202
});
203203

204-
group.bench_function(format!("{}::yield_now", prefix), |b| {
204+
group.bench_function(format!("{prefix}::yield_now"), |b| {
205205
if with_static {
206206
run_static(
207207
|| {
@@ -247,7 +247,7 @@ fn running_benches(c: &mut Criterion) {
247247
}
248248
});
249249

250-
group.bench_function(format!("{}::channels", prefix), |b| {
250+
group.bench_function(format!("{prefix}::channels"), |b| {
251251
if with_static {
252252
run_static(
253253
|| {
@@ -325,7 +325,7 @@ fn running_benches(c: &mut Criterion) {
325325
}
326326
});
327327

328-
group.bench_function(format!("{}::web_server", prefix), |b| {
328+
group.bench_function(format!("{prefix}::web_server"), |b| {
329329
if with_static {
330330
run_static(
331331
|| {

examples/priority.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ fn main() {
7272

7373
// Spawn a task with this priority.
7474
tasks.push(EX.spawn(priority, async move {
75-
println!("{:?}", priority);
75+
println!("{priority:?}");
7676
future::yield_now().await;
77-
println!("{:?}", priority);
77+
println!("{priority:?}");
7878
}));
7979
}
8080

0 commit comments

Comments
 (0)