Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Uriopass committed Jan 4, 2024
1 parent 69f88d3 commit 7ddcd89
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
3 changes: 1 addition & 2 deletions engine/src/drawables/lit_mesh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ pub fn screen_coverage(gfx: &GfxContext, s: Sphere) -> f32 {

let proj_radius2 = (proj_center_side - proj_center).mag2();

let screen_area = proj_radius2 * std::f32::consts::PI;
screen_area
proj_radius2 * std::f32::consts::PI
}

#[derive(Clone, Copy, Hash)]
Expand Down
2 changes: 1 addition & 1 deletion engine/src/meshload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ pub fn find_nodes<'a>(
let coverage = v.get("screencoverage").map(|v| {
v.as_array()
.unwrap()
.into_iter()
.iter()
.map(|v| v.as_f64().unwrap())
.collect::<Vec<_>>()
});
Expand Down
3 changes: 2 additions & 1 deletion geom/src/heightmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,8 @@ mod erosion {
}

for c in &changed {
self.get_chunk_mut(*c).map(|c| c.update_max_height());
let Some(c) = self.get_chunk_mut(*c) else { continue; };
c.update_max_height();
}

changed.into_iter().collect()
Expand Down
4 changes: 2 additions & 2 deletions simulation/src/utils/rand_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ impl RandProvider {

// used only for the initial seed
fn splitmix64(state: &mut u64) -> u64 {
*state = state.wrapping_add(0x9E3779B97f4A7C15);
*state = state.wrapping_add(0x9E3779B97F4A7C15);
let mut result = *state;
result = (result ^ (result >> 30)).wrapping_mul(0xBF58476D1CE4E5B9);
result = (result ^ (result >> 27)).wrapping_mul(0x94D049BB133111EB);
return result ^ (result >> 31);
result ^ (result >> 31)
}

0 comments on commit 7ddcd89

Please sign in to comment.