diff options
author | Yuri Astrakhan <yuriastrakhan@gmail.com> | 2022-06-01 21:22:50 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-02 01:22:50 +0000 |
commit | 56a69c0bfe5742aeda1c4942b748f5a842ce6773 (patch) | |
tree | 511c45e5a79a7f77dde3521bf5784a8ad476e6a8 /alacritty_terminal/src/term | |
parent | e20541a83e55d5ddd57b1bed0f4666b3c73f680d (diff) | |
download | alacritty-56a69c0bfe5742aeda1c4942b748f5a842ce6773.tar.gz alacritty-56a69c0bfe5742aeda1c4942b748f5a842ce6773.zip |
Fix a few minor clippy lints
Diffstat (limited to 'alacritty_terminal/src/term')
-rw-r--r-- | alacritty_terminal/src/term/color.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/alacritty_terminal/src/term/color.rs b/alacritty_terminal/src/term/color.rs index 32c6af2b..a9494e7a 100644 --- a/alacritty_terminal/src/term/color.rs +++ b/alacritty_terminal/src/term/color.rs @@ -287,23 +287,21 @@ impl IndexMut<NamedColor> for Colors { mod tests { use super::*; - use std::f64::EPSILON; - #[test] fn contrast() { let rgb1 = Rgb { r: 0xff, g: 0xff, b: 0xff }; let rgb2 = Rgb { r: 0x00, g: 0x00, b: 0x00 }; - assert!((rgb1.contrast(rgb2) - 21.).abs() < EPSILON); + assert!((rgb1.contrast(rgb2) - 21.).abs() < f64::EPSILON); let rgb1 = Rgb { r: 0xff, g: 0xff, b: 0xff }; - assert!((rgb1.contrast(rgb1) - 1.).abs() < EPSILON); + assert!((rgb1.contrast(rgb1) - 1.).abs() < f64::EPSILON); let rgb1 = Rgb { r: 0xff, g: 0x00, b: 0xff }; let rgb2 = Rgb { r: 0x00, g: 0xff, b: 0x00 }; - assert!((rgb1.contrast(rgb2) - 2.285_543_608_124_253_3).abs() < EPSILON); + assert!((rgb1.contrast(rgb2) - 2.285_543_608_124_253_3).abs() < f64::EPSILON); let rgb1 = Rgb { r: 0x12, g: 0x34, b: 0x56 }; let rgb2 = Rgb { r: 0xfe, g: 0xdc, b: 0xba }; - assert!((rgb1.contrast(rgb2) - 9.786_558_997_257_74).abs() < EPSILON); + assert!((rgb1.contrast(rgb2) - 9.786_558_997_257_74).abs() < f64::EPSILON); } } |