Skip to content

Commit

Permalink
refactor: cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
manankarnik committed Apr 12, 2024
1 parent a03c5bf commit 22b60e2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 6 additions & 1 deletion src/noise.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,12 @@ pub(crate) fn generate_noise_map(noise: &Noise) -> Vec<Vec<f64>> {
)
}

pub(crate) fn generate_noise<T>(size: [u32; 2], seed: u32, scale: f64, offset: [f64; 2]) -> Vec<Vec<f64>>
pub(crate) fn generate_noise<T>(
size: [u32; 2],
seed: u32,
scale: f64,
offset: [f64; 2],
) -> Vec<Vec<f64>>
where
T: Default + Seedable + NoiseFn<f64, 2>,
{
Expand Down
8 changes: 2 additions & 6 deletions src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,8 @@ mod tests {

#[test]
fn test_noise_at_point_3d() {
let noise_value = noise_at_point_3d::<noise::Perlin>(
[1.0, 2.0, 3.0],
123,
0.1,
[0.0, 0.0, 0.0],
);
let noise_value =
noise_at_point_3d::<noise::Perlin>([1.0, 2.0, 3.0], 123, 0.1, [0.0, 0.0, 0.0]);
assert!(noise_value >= -1.0 && noise_value <= 1.0);
}
}

0 comments on commit 22b60e2

Please sign in to comment.