Revert "Resolve all '#[allow(clippy::excessive_precision)]' error supressions"

This reverts commit 0247ae2bf6.
This commit is contained in:
Avi Weinstock 2021-07-25 12:29:21 -04:00
parent 516ad1c772
commit edad38098f
2 changed files with 8 additions and 4 deletions

View File

@ -1,17 +1,19 @@
use vek::{Mat3, Rgb, Rgba, Vec3}; use vek::{Mat3, Rgb, Rgba, Vec3};
#[inline(always)] #[inline(always)]
#[allow(clippy::excessive_precision)]
pub fn srgb_to_linear(col: Rgb<f32>) -> Rgb<f32> { pub fn srgb_to_linear(col: Rgb<f32>) -> Rgb<f32> {
col.map(|c| { col.map(|c| {
if c <= 0.104 { if c <= 0.104 {
c * 0.08677088 c * 0.08677088
} else { } 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)] #[inline(always)]
#[allow(clippy::excessive_precision)]
pub fn linear_to_srgb(col: Rgb<f32>) -> Rgb<f32> { pub fn linear_to_srgb(col: Rgb<f32>) -> Rgb<f32> {
col.map(|c| { col.map(|c| {
if c <= 0.0060 { if c <= 0.0060 {
@ -20,7 +22,7 @@ pub fn linear_to_srgb(col: Rgb<f32>) -> Rgb<f32> {
let s1 = c.sqrt(); let s1 = c.sqrt();
let s2 = s1.sqrt(); let s2 = s1.sqrt();
let s3 = s2.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
} }
}) })
} }

View File

@ -13,8 +13,9 @@ impl FastNoise {
} }
} }
#[allow(clippy::excessive_precision)] // TODO: Pending review in #587
fn noise_at(&self, pos: Vec3<i32>) -> f32 { fn noise_at(&self, pos: Vec3<i32>) -> 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<i32>) -> f32 { fn noise_at(&self, pos: Vec2<i32>) -> 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
} }
} }