Skip to content

Commit

Permalink
Fix a few uninlined_format_args lints (#7368)
Browse files Browse the repository at this point in the history
# Objective

Prevent things from breaking tomorrow when rust 1.67 is released.

## Solution

Fix a few `uninlined_format_args` lints in recently introduced code.
  • Loading branch information
rparrett committed Jan 26, 2023
1 parent 6b38863 commit 461497f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions crates/bevy_pbr/src/light.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,13 +280,11 @@ impl CascadeShadowConfig {
) -> Self {
assert!(
num_cascades > 0,
"num_cascades must be positive, but was {}",
num_cascades
"num_cascades must be positive, but was {num_cascades}",
);
assert!(
(0.0..1.0).contains(&overlap_proportion),
"overlap_proportion must be in [0.0, 1.0) but was {}",
overlap_proportion
"overlap_proportion must be in [0.0, 1.0) but was {overlap_proportion}",
);
Self {
bounds: calculate_cascade_bounds(num_cascades, nearest_bound, shadow_maximum_distance),
Expand Down Expand Up @@ -397,8 +395,8 @@ fn calculate_cascade(
z_near: f32,
z_far: f32,
) -> Cascade {
debug_assert!(z_near <= 0.0, "z_near {} must be <= 0.0", z_near);
debug_assert!(z_far <= 0.0, "z_far {} must be <= 0.0", z_far);
debug_assert!(z_near <= 0.0, "z_near {z_near} must be <= 0.0");
debug_assert!(z_far <= 0.0, "z_far {z_far} must be <= 0.0");
// NOTE: This whole function is very sensitive to floating point precision and instability and
// has followed instructions to avoid view dependence from the section on cascade shadow maps in
// Eric Lengyel's Foundations of Game Engine Development 2: Rendering. Be very careful when
Expand Down
2 changes: 1 addition & 1 deletion examples/shader/texture_binding_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ fn setup(
let textures: Vec<_> = TILE_ID
.iter()
.map(|id| {
let path = format!("textures/rpg/tiles/generic-rpg-tile{:0>2}.png", id);
let path = format!("textures/rpg/tiles/generic-rpg-tile{id:0>2}.png");
asset_server.load(path)
})
.collect();
Expand Down

0 comments on commit 461497f

Please sign in to comment.