Skip to content

Commit 8eb6ccd

Browse files
authored
Remove useless single tuples and trailing commas (#9720)
# Objective Title
1 parent e663d45 commit 8eb6ccd

File tree

18 files changed

+64
-62
lines changed

18 files changed

+64
-62
lines changed

benches/benches/bevy_ecs/change_detection.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ fn deterministic_rand() -> ChaCha8Rng {
5151

5252
fn setup<T: Component + Default>(entity_count: u32) -> World {
5353
let mut world = World::default();
54-
world.spawn_batch((0..entity_count).map(|_| (T::default(),)));
54+
world.spawn_batch((0..entity_count).map(|_| T::default()));
5555
black_box(world)
5656
}
5757

benches/benches/bevy_ecs/events/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use criterion::*;
33
mod iter;
44
mod send;
55

6-
criterion_group!(event_benches, send, iter,);
6+
criterion_group!(event_benches, send, iter);
77

88
fn send(c: &mut Criterion) {
99
let mut group = c.benchmark_group("events_send");

benches/benches/bevy_ecs/world/world_get.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ pub fn query_get(criterion: &mut Criterion) {
383383
group.bench_function(format!("{}_entities_sparse", entity_count), |bencher| {
384384
let mut world = World::default();
385385
let mut entities: Vec<_> = world
386-
.spawn_batch((0..entity_count).map(|_| (Sparse::default(),)))
386+
.spawn_batch((0..entity_count).map(|_| Sparse::default()))
387387
.collect();
388388
entities.shuffle(&mut deterministic_rand());
389389
let mut query = SystemState::<Query<&Sparse>>::new(&mut world);

crates/bevy_ecs/src/lib.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1529,19 +1529,19 @@ mod tests {
15291529
world.spawn((B(1), C));
15301530
world.spawn(A(1));
15311531
world.spawn(C);
1532-
assert_eq!(2, query_min_size![(), (With<A>, Without<B>)],);
1533-
assert_eq!(3, query_min_size![&B, Or<(With<A>, With<C>)>],);
1534-
assert_eq!(1, query_min_size![&B, (With<A>, With<C>)],);
1535-
assert_eq!(1, query_min_size![(&A, &B), With<C>],);
1532+
assert_eq!(2, query_min_size![(), (With<A>, Without<B>)]);
1533+
assert_eq!(3, query_min_size![&B, Or<(With<A>, With<C>)>]);
1534+
assert_eq!(1, query_min_size![&B, (With<A>, With<C>)]);
1535+
assert_eq!(1, query_min_size![(&A, &B), With<C>]);
15361536
assert_eq!(4, query_min_size![&A, ()], "Simple Archetypal");
1537-
assert_eq!(4, query_min_size![Ref<A>, ()],);
1537+
assert_eq!(4, query_min_size![Ref<A>, ()]);
15381538
// All the following should set minimum size to 0, as it's impossible to predict
15391539
// how many entities the filters will trim.
15401540
assert_eq!(0, query_min_size![(), Added<A>], "Simple Added");
15411541
assert_eq!(0, query_min_size![(), Changed<A>], "Simple Changed");
1542-
assert_eq!(0, query_min_size![(&A, &B), Changed<A>],);
1543-
assert_eq!(0, query_min_size![&A, (Changed<A>, With<B>)],);
1544-
assert_eq!(0, query_min_size![(&A, &B), Or<(Changed<A>, Changed<B>)>],);
1542+
assert_eq!(0, query_min_size![(&A, &B), Changed<A>]);
1543+
assert_eq!(0, query_min_size![&A, (Changed<A>, With<B>)]);
1544+
assert_eq!(0, query_min_size![(&A, &B), Or<(Changed<A>, Changed<B>)>]);
15451545
}
15461546

15471547
#[test]

crates/bevy_hierarchy/src/child_builder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ mod tests {
904904
fn push_and_clear_children_commands() {
905905
let mut world = World::default();
906906
let entities = world
907-
.spawn_batch(vec![(C(1),), (C(2),), (C(3),), (C(4),), (C(5),)])
907+
.spawn_batch(vec![C(1), C(2), C(3), C(4), C(5)])
908908
.collect::<Vec<Entity>>();
909909

910910
let mut queue = CommandQueue::default();
@@ -942,7 +942,7 @@ mod tests {
942942
fn push_and_replace_children_commands() {
943943
let mut world = World::default();
944944
let entities = world
945-
.spawn_batch(vec![(C(1),), (C(2),), (C(3),), (C(4),), (C(5),)])
945+
.spawn_batch(vec![C(1), C(2), C(3), C(4), C(5)])
946946
.collect::<Vec<Entity>>();
947947

948948
let mut queue = CommandQueue::default();

crates/bevy_pbr/src/render/light.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1063,7 +1063,7 @@ pub fn prepare_lights(
10631063
.spawn((
10641064
ShadowView {
10651065
depth_texture_view,
1066-
pass_name: format!("shadow pass spot light {light_index}",),
1066+
pass_name: format!("shadow pass spot light {light_index}"),
10671067
},
10681068
ExtractedView {
10691069
viewport: UVec4::new(

crates/bevy_reflect/src/serde/de.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1078,7 +1078,7 @@ fn get_registration<'a, E: Error>(
10781078
registry: &'a TypeRegistry,
10791079
) -> Result<&'a TypeRegistration, E> {
10801080
let registration = registry.get(type_id).ok_or_else(|| {
1081-
Error::custom(format_args!("no registration found for type `{type_name}`",))
1081+
Error::custom(format_args!("no registration found for type `{type_name}`"))
10821082
})?;
10831083
Ok(registration)
10841084
}

crates/bevy_render/src/color/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1892,7 +1892,7 @@ mod tests {
18921892
let starting_vec4 = Vec4::new(0.4, 0.5, 0.6, 1.0);
18931893
let starting_color = Color::from(starting_vec4);
18941894

1895-
assert_eq!(starting_vec4, Vec4::from(starting_color),);
1895+
assert_eq!(starting_vec4, Vec4::from(starting_color));
18961896

18971897
let transformation = Vec4::new(0.5, 0.5, 0.5, 1.0);
18981898

@@ -1915,7 +1915,7 @@ mod tests {
19151915
let mut mutated_color = starting_color;
19161916
mutated_color *= transformation;
19171917

1918-
assert_eq!(starting_color * transformation, mutated_color,);
1918+
assert_eq!(starting_color * transformation, mutated_color);
19191919
}
19201920

19211921
#[test]
@@ -1931,7 +1931,7 @@ mod tests {
19311931
let mut mutated_color = starting_color;
19321932
mutated_color *= transformation;
19331933

1934-
assert_eq!(starting_color * transformation, mutated_color,);
1934+
assert_eq!(starting_color * transformation, mutated_color);
19351935
}
19361936

19371937
#[test]
@@ -1947,7 +1947,7 @@ mod tests {
19471947
let mut mutated_color = starting_color;
19481948
mutated_color *= transformation;
19491949

1950-
assert_eq!(starting_color * transformation, mutated_color,);
1950+
assert_eq!(starting_color * transformation, mutated_color);
19511951
}
19521952

19531953
#[test]
@@ -1963,7 +1963,7 @@ mod tests {
19631963
let mut mutated_color = starting_color;
19641964
mutated_color *= transformation;
19651965

1966-
assert_eq!(starting_color * transformation, mutated_color,);
1966+
assert_eq!(starting_color * transformation, mutated_color);
19671967
}
19681968

19691969
#[test]
@@ -1979,7 +1979,7 @@ mod tests {
19791979
let mut mutated_color = starting_color;
19801980
mutated_color *= transformation;
19811981

1982-
assert_eq!(starting_color * transformation, mutated_color,);
1982+
assert_eq!(starting_color * transformation, mutated_color);
19831983
}
19841984

19851985
// regression test for https://github.com/bevyengine/bevy/pull/8040

crates/bevy_scene/src/serde.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ mod tests {
806806
.find(|dynamic_entity| dynamic_entity.entity == expected.entity)
807807
.unwrap_or_else(|| panic!("missing entity (expected: `{:?}`)", expected.entity));
808808

809-
assert_eq!(expected.entity, received.entity, "entities did not match",);
809+
assert_eq!(expected.entity, received.entity, "entities did not match");
810810

811811
for expected in &expected.components {
812812
let received = received

crates/bevy_time/src/time.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ mod tests {
484484
assert_eq!(time.raw_delta(), Duration::ZERO);
485485
assert_eq!(time.raw_delta_seconds(), 0.0);
486486
assert_eq!(time.raw_delta_seconds_f64(), 0.0);
487-
assert_eq!(time.elapsed(), first_update_instant - start_instant,);
487+
assert_eq!(time.elapsed(), first_update_instant - start_instant);
488488
assert_eq!(
489489
time.elapsed_seconds(),
490490
(first_update_instant - start_instant).as_secs_f32(),
@@ -493,7 +493,7 @@ mod tests {
493493
time.elapsed_seconds_f64(),
494494
(first_update_instant - start_instant).as_secs_f64(),
495495
);
496-
assert_eq!(time.raw_elapsed(), first_update_instant - start_instant,);
496+
assert_eq!(time.raw_elapsed(), first_update_instant - start_instant);
497497
assert_eq!(
498498
time.raw_elapsed_seconds(),
499499
(first_update_instant - start_instant).as_secs_f32(),
@@ -532,7 +532,7 @@ mod tests {
532532
time.raw_delta_seconds_f64(),
533533
(second_update_instant - first_update_instant).as_secs_f64(),
534534
);
535-
assert_eq!(time.elapsed(), second_update_instant - start_instant,);
535+
assert_eq!(time.elapsed(), second_update_instant - start_instant);
536536
assert_eq!(
537537
time.elapsed_seconds(),
538538
(second_update_instant - start_instant).as_secs_f32(),
@@ -541,7 +541,7 @@ mod tests {
541541
time.elapsed_seconds_f64(),
542542
(second_update_instant - start_instant).as_secs_f64(),
543543
);
544-
assert_eq!(time.raw_elapsed(), second_update_instant - start_instant,);
544+
assert_eq!(time.raw_elapsed(), second_update_instant - start_instant);
545545
assert_eq!(
546546
time.raw_elapsed_seconds(),
547547
(second_update_instant - start_instant).as_secs_f32(),
@@ -614,7 +614,7 @@ mod tests {
614614
time.raw_delta_seconds_f64(),
615615
(second_update_instant - first_update_instant).as_secs_f64(),
616616
);
617-
assert_eq!(time.elapsed(), second_update_instant - start_instant,);
617+
assert_eq!(time.elapsed(), second_update_instant - start_instant);
618618
assert_eq!(
619619
time.elapsed_seconds(),
620620
(second_update_instant - start_instant).as_secs_f32(),
@@ -623,7 +623,7 @@ mod tests {
623623
time.elapsed_seconds_f64(),
624624
(second_update_instant - start_instant).as_secs_f64(),
625625
);
626-
assert_eq!(time.raw_elapsed(), second_update_instant - start_instant,);
626+
assert_eq!(time.raw_elapsed(), second_update_instant - start_instant);
627627
assert_eq!(
628628
time.raw_elapsed_seconds(),
629629
(second_update_instant - start_instant).as_secs_f32(),

0 commit comments

Comments
 (0)