Skip to content

Commit 4efc34b

Browse files
authored
fix clippy (#668)
1 parent 39b796e commit 4efc34b

File tree

3 files changed

+16
-22
lines changed

3 files changed

+16
-22
lines changed

src/geometry/shape_views/collider_view.rs

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -263,15 +263,15 @@ impl<'a> ColliderView<'a> {
263263
}),
264264
ColliderView::Capsule(c) => match c.raw.scaled(&scale.into(), num_subdivisions) {
265265
None => {
266-
log::error!("Failed to apply scale {} to Capsule shape.", scale);
266+
log::error!("Failed to apply scale {scale} to Capsule shape.");
267267
SharedShape::ball(0.0)
268268
}
269269
Some(Either::Left(b)) => SharedShape::new(b),
270270
Some(Either::Right(b)) => SharedShape::new(b),
271271
},
272272
ColliderView::Ball(b) => match b.raw.scaled(&scale.into(), num_subdivisions) {
273273
None => {
274-
log::error!("Failed to apply scale {} to Ball shape.", scale);
274+
log::error!("Failed to apply scale {scale} to Ball shape.");
275275
SharedShape::ball(0.0)
276276
}
277277
Some(Either::Left(b)) => SharedShape::new(b),
@@ -281,7 +281,7 @@ impl<'a> ColliderView<'a> {
281281
ColliderView::Triangle(t) => SharedShape::new(t.raw.scaled(&scale.into())),
282282
ColliderView::Voxels(cp) => match cp.raw.clone().scaled(&scale.into()) {
283283
None => {
284-
log::error!("Failed to apply scale {} to Voxels shape.", scale);
284+
log::error!("Failed to apply scale {scale} to Voxels shape.");
285285
SharedShape::ball(0.0)
286286
}
287287
Some(scaled) => SharedShape::new(scaled),
@@ -294,7 +294,7 @@ impl<'a> ColliderView<'a> {
294294
ColliderView::Polyline(p) => SharedShape::new(p.raw.clone().scaled(&scale.into())),
295295
ColliderView::HalfSpace(h) => match h.raw.scaled(&scale.into()) {
296296
None => {
297-
log::error!("Failed to apply scale {} to HalfSpace shape.", scale);
297+
log::error!("Failed to apply scale {scale} to HalfSpace shape.");
298298
SharedShape::ball(0.0)
299299
}
300300
Some(scaled) => SharedShape::new(scaled),
@@ -303,7 +303,7 @@ impl<'a> ColliderView<'a> {
303303
#[cfg(feature = "dim2")]
304304
ColliderView::ConvexPolygon(cp) => match cp.raw.clone().scaled(&scale.into()) {
305305
None => {
306-
log::error!("Failed to apply scale {} to ConvexPolygon shape.", scale);
306+
log::error!("Failed to apply scale {scale} to ConvexPolygon shape.");
307307
SharedShape::ball(0.0)
308308
}
309309
Some(scaled) => SharedShape::new(scaled),
@@ -312,10 +312,7 @@ impl<'a> ColliderView<'a> {
312312
ColliderView::RoundConvexPolygon(cp) => {
313313
match cp.raw.inner_shape.clone().scaled(&scale.into()) {
314314
None => {
315-
log::error!(
316-
"Failed to apply scale {} to RoundConvexPolygon shape.",
317-
scale
318-
);
315+
log::error!("Failed to apply scale {scale} to RoundConvexPolygon shape.");
319316
SharedShape::ball(0.0)
320317
}
321318
Some(scaled) => SharedShape::new(RoundShape {
@@ -327,7 +324,7 @@ impl<'a> ColliderView<'a> {
327324
#[cfg(feature = "dim3")]
328325
ColliderView::ConvexPolyhedron(cp) => match cp.raw.clone().scaled(&scale.into()) {
329326
None => {
330-
log::error!("Failed to apply scale {} to ConvexPolyhedron shape.", scale);
327+
log::error!("Failed to apply scale {scale} to ConvexPolyhedron shape.");
331328
SharedShape::ball(0.0)
332329
}
333330
Some(scaled) => SharedShape::new(scaled),
@@ -337,8 +334,7 @@ impl<'a> ColliderView<'a> {
337334
match cp.raw.clone().inner_shape.scaled(&scale.into()) {
338335
None => {
339336
log::error!(
340-
"Failed to apply scale {} to RoundConvexPolyhedron shape.",
341-
scale
337+
"Failed to apply scale {scale} to RoundConvexPolyhedron shape."
342338
);
343339
SharedShape::ball(0.0)
344340
}
@@ -351,7 +347,7 @@ impl<'a> ColliderView<'a> {
351347
#[cfg(feature = "dim3")]
352348
ColliderView::Cylinder(c) => match c.raw.scaled(&scale.into(), num_subdivisions) {
353349
None => {
354-
log::error!("Failed to apply scale {} to Cylinder shape.", scale);
350+
log::error!("Failed to apply scale {scale} to Cylinder shape.");
355351
SharedShape::ball(0.0)
356352
}
357353
Some(Either::Left(b)) => SharedShape::new(b),
@@ -361,7 +357,7 @@ impl<'a> ColliderView<'a> {
361357
ColliderView::RoundCylinder(c) => {
362358
match c.raw.inner_shape.scaled(&scale.into(), num_subdivisions) {
363359
None => {
364-
log::error!("Failed to apply scale {} to RoundCylinder shape.", scale);
360+
log::error!("Failed to apply scale {scale} to RoundCylinder shape.");
365361
SharedShape::ball(0.0)
366362
}
367363
Some(Either::Left(scaled)) => SharedShape::new(RoundShape {
@@ -377,7 +373,7 @@ impl<'a> ColliderView<'a> {
377373
#[cfg(feature = "dim3")]
378374
ColliderView::Cone(c) => match c.raw.scaled(&scale.into(), num_subdivisions) {
379375
None => {
380-
log::error!("Failed to apply scale {} to Cone shape.", scale);
376+
log::error!("Failed to apply scale {scale} to Cone shape.");
381377
SharedShape::ball(0.0)
382378
}
383379
Some(Either::Left(b)) => SharedShape::new(b),
@@ -387,7 +383,7 @@ impl<'a> ColliderView<'a> {
387383
ColliderView::RoundCone(c) => {
388384
match c.raw.inner_shape.scaled(&scale.into(), num_subdivisions) {
389385
None => {
390-
log::error!("Failed to apply scale {} to RoundCone shape.", scale);
386+
log::error!("Failed to apply scale {scale} to RoundCone shape.");
391387
SharedShape::ball(0.0)
392388
}
393389
Some(Either::Left(scaled)) => SharedShape::new(RoundShape {

src/plugin/plugin.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ where
275275
log::warn!("RapierPhysicsPlugin added but a `RapierContextInitialization` resource was already existing.\
276276
This might overwrite previous configuration made via `RapierPhysicsPlugin::with_custom_initialization`\
277277
or `RapierPhysicsPlugin::with_length_unit`.
278-
The following resource will be used: {:?}", world_init);
278+
The following resource will be used: {world_init:?}");
279279
} else {
280280
app.insert_resource(self.default_world_setup.clone());
281281
}
@@ -331,7 +331,7 @@ where
331331
match config {
332332
TimestepMode::Fixed { .. } => {}
333333
mode => {
334-
log::warn!("TimestepMode is set to `{:?}`, it is recommended to use `TimestepMode::Fixed` if you have the physics in `FixedUpdate`", mode);
334+
log::warn!("TimestepMode is set to `{mode:?}`, it is recommended to use `TimestepMode::Fixed` if you have the physics in `FixedUpdate`");
335335
}
336336
}
337337
}

src/plugin/systems/collider.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ pub fn init_async_colliders(
521521
.insert(collider)
522522
.remove::<AsyncCollider>();
523523
}
524-
None => log::error!("Unable to generate collider from mesh {:?}", mesh),
524+
None => log::error!("Unable to generate collider from mesh {mesh:?}"),
525525
}
526526
}
527527
}
@@ -553,9 +553,7 @@ pub fn init_async_scene_colliders(
553553
commands.entity(child_entity).insert(collider);
554554
}
555555
None => log::error!(
556-
"Unable to generate collider from mesh {:?} with name {}",
557-
mesh,
558-
name
556+
"Unable to generate collider from mesh {mesh:?} with name {name}"
559557
),
560558
}
561559
}

0 commit comments

Comments
 (0)