diff --git a/common/src/util/color.rs b/common/src/util/color.rs index f3ae9ca9bc..c1e4c273d2 100644 --- a/common/src/util/color.rs +++ b/common/src/util/color.rs @@ -1,17 +1,19 @@ use vek::{Mat3, Rgb, Rgba, Vec3}; #[inline(always)] +#[allow(clippy::excessive_precision)] pub fn srgb_to_linear(col: Rgb) -> Rgb { col.map(|c| { if c <= 0.104 { c * 0.08677088 } else { - 0.012522878 * c + 0.682_171_1 * c * c + 0.305_306_02 * c * c * c + 0.012522878 * c + 0.682171111 * c * c + 0.305306011 * c * c * c } }) } #[inline(always)] +#[allow(clippy::excessive_precision)] pub fn linear_to_srgb(col: Rgb) -> Rgb { col.map(|c| { if c <= 0.0060 { @@ -20,7 +22,7 @@ pub fn linear_to_srgb(col: Rgb) -> Rgb { let s1 = c.sqrt(); let s2 = s1.sqrt(); let s3 = s2.sqrt(); - 0.585_122_4 * s1 + 0.783_140_36 * s2 - 0.368_262_74 * s3 + 0.585122381 * s1 + 0.783140355 * s2 - 0.368262736 * s3 } }) } diff --git a/world/src/util/fast_noise.rs b/world/src/util/fast_noise.rs index cf1c752b7a..84ac0dc87a 100644 --- a/world/src/util/fast_noise.rs +++ b/world/src/util/fast_noise.rs @@ -13,8 +13,9 @@ impl FastNoise { } } + #[allow(clippy::excessive_precision)] // TODO: Pending review in #587 fn noise_at(&self, pos: Vec3) -> f32 { - (self.noise.get(pos) & 4095) as f32 * 0.000_244_140_63 + (self.noise.get(pos) & 4095) as f32 * 0.000244140625 } } @@ -86,8 +87,9 @@ impl FastNoise2d { } } + #[allow(clippy::excessive_precision)] // TODO: Pending review in #587 fn noise_at(&self, pos: Vec2) -> f32 { - (self.noise.get(Vec3::new(pos.x, pos.y, 0)) & 4095) as f32 * 0.000_244_140_63 + (self.noise.get(Vec3::new(pos.x, pos.y, 0)) & 4095) as f32 * 0.000244140625 } }