Skip to content

Commit c8feb2a

Browse files
committed
chore: fix several clippy lints
1 parent 3081313 commit c8feb2a

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

benches/benches/bevy_ecs/iteration/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ fn par_iter_simple(c: &mut Criterion) {
136136
b.iter(move || bench.run());
137137
});
138138
}
139-
group.bench_function(format!("hybrid"), |b| {
139+
group.bench_function("hybrid".to_string(), |b| {
140140
let mut bench = par_iter_simple_foreach_hybrid::Benchmark::new();
141141
b.iter(move || bench.run());
142142
});

benches/benches/bevy_ecs/scheduling/run_condition.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub fn run_condition_yes(criterion: &mut Criterion) {
2525
}
2626
// run once to initialize systems
2727
schedule.run(&mut world);
28-
group.bench_function(&format!("{:03}_systems", 5 * amount + 1), |bencher| {
28+
group.bench_function(format!("{:03}_systems", 5 * amount + 1), |bencher| {
2929
bencher.iter(|| {
3030
schedule.run(&mut world);
3131
});
@@ -48,7 +48,7 @@ pub fn run_condition_no(criterion: &mut Criterion) {
4848
}
4949
// run once to initialize systems
5050
schedule.run(&mut world);
51-
group.bench_function(&format!("{:03}_systems", 5 * amount + 1), |bencher| {
51+
group.bench_function(format!("{:03}_systems", 5 * amount + 1), |bencher| {
5252
bencher.iter(|| {
5353
schedule.run(&mut world);
5454
});
@@ -80,7 +80,7 @@ pub fn run_condition_yes_with_query(criterion: &mut Criterion) {
8080
}
8181
// run once to initialize systems
8282
schedule.run(&mut world);
83-
group.bench_function(&format!("{:03}_systems", 5 * amount + 1), |bencher| {
83+
group.bench_function(format!("{:03}_systems", 5 * amount + 1), |bencher| {
8484
bencher.iter(|| {
8585
schedule.run(&mut world);
8686
});
@@ -109,7 +109,7 @@ pub fn run_condition_yes_with_resource(criterion: &mut Criterion) {
109109
}
110110
// run once to initialize systems
111111
schedule.run(&mut world);
112-
group.bench_function(&format!("{:03}_systems", 5 * amount + 1), |bencher| {
112+
group.bench_function(format!("{:03}_systems", 5 * amount + 1), |bencher| {
113113
bencher.iter(|| {
114114
schedule.run(&mut world);
115115
});

benches/benches/bevy_ecs/scheduling/running_systems.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub fn empty_systems(criterion: &mut Criterion) {
2626
schedule.add_systems(empty);
2727
}
2828
schedule.run(&mut world);
29-
group.bench_function(&format!("{:03}_systems", amount), |bencher| {
29+
group.bench_function(format!("{:03}_systems", amount), |bencher| {
3030
bencher.iter(|| {
3131
schedule.run(&mut world);
3232
});
@@ -38,7 +38,7 @@ pub fn empty_systems(criterion: &mut Criterion) {
3838
schedule.add_systems((empty, empty, empty, empty, empty));
3939
}
4040
schedule.run(&mut world);
41-
group.bench_function(&format!("{:03}_systems", 5 * amount), |bencher| {
41+
group.bench_function(format!("{:03}_systems", 5 * amount), |bencher| {
4242
bencher.iter(|| {
4343
schedule.run(&mut world);
4444
});
@@ -80,7 +80,7 @@ pub fn busy_systems(criterion: &mut Criterion) {
8080
}
8181
schedule.run(&mut world);
8282
group.bench_function(
83-
&format!(
83+
format!(
8484
"{:02}x_entities_{:02}_systems",
8585
entity_bunches,
8686
3 * system_amount + 3
@@ -131,7 +131,7 @@ pub fn contrived(criterion: &mut Criterion) {
131131
}
132132
schedule.run(&mut world);
133133
group.bench_function(
134-
&format!(
134+
format!(
135135
"{:02}x_entities_{:02}_systems",
136136
entity_bunches,
137137
3 * system_amount + 3

benches/benches/bevy_ecs/scheduling/schedule.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ pub fn build_schedule(criterion: &mut Criterion) {
7474
// Method: generate a set of `graph_size` systems which have a One True Ordering.
7575
// Add system to the schedule with full constraints. Hopefully this should be maximally
7676
// difficult for bevy to figure out.
77-
let labels: Vec<_> = (0..1000).map(|i| NumSet(i)).collect();
77+
let labels: Vec<_> = (0..1000).map(NumSet).collect();
7878

7979
// Benchmark graphs of different sizes.
8080
for graph_size in [100, 500, 1000] {

benches/benches/bevy_ecs/world/world_get.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ pub fn query_get(criterion: &mut Criterion) {
306306
}
307307

308308
pub fn query_get_many<const N: usize>(criterion: &mut Criterion) {
309-
let mut group = criterion.benchmark_group(&format!("query_get_many_{N}"));
309+
let mut group = criterion.benchmark_group(format!("query_get_many_{N}"));
310310
group.warm_up_time(core::time::Duration::from_millis(500));
311311
group.measurement_time(core::time::Duration::from_secs(2 * N as u64));
312312

benches/benches/bevy_reflect/path.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ fn deterministic_rand() -> ChaCha8Rng {
1717
ChaCha8Rng::seed_from_u64(42)
1818
}
1919
fn random_ident(rng: &mut ChaCha8Rng, f: &mut dyn Write) {
20-
let between = Uniform::try_from(b'a'..=b'z').unwrap();
20+
let between = Uniform::from(b'a'..=b'z');
2121
let ident_size = rng.gen_range(1..128);
2222
let ident: Vec<u8> = rng.sample_iter(between).take(ident_size).collect();
2323
let ident = str::from_utf8(&ident).unwrap();
@@ -79,9 +79,9 @@ fn parse_reflect_path(criterion: &mut Criterion) {
7979
BenchmarkId::new("parse_reflect_path", size),
8080
&size,
8181
|bencher, &size| {
82-
let mut mk_paths = mk_paths(size);
82+
let mk_paths = mk_paths(size);
8383
bencher.iter_batched(
84-
|| mk_paths(),
84+
mk_paths,
8585
|path| assert!(ParsedPath::parse(black_box(&path)).is_ok()),
8686
BatchSize::SmallInput,
8787
);

0 commit comments

Comments
 (0)