fix all clippy lints and remove them from allow list in cranky (#2419)
* manual range contains clippy lint removed from allow list * removed multiple redundant allowed clippy lints
This commit is contained in:
parent
228f30ed46
commit
930ef2db38
5 changed files with 11 additions and 17 deletions
|
@ -115,9 +115,4 @@ warn = [
|
|||
allow = [
|
||||
# TODO(emilk): enable more lints
|
||||
"clippy::type_complexity",
|
||||
"clippy::undocumented_unsafe_blocks",
|
||||
"clippy::manual_range_contains",
|
||||
"trivial_casts",
|
||||
"unsafe_op_in_unsafe_fn", # `unsafe_op_in_unsafe_fn` may become the default in future Rust versions: https://github.com/rust-lang/rust/issues/71668
|
||||
"unused_qualifications",
|
||||
]
|
||||
|
|
|
@ -173,7 +173,7 @@ impl Color32 {
|
|||
|
||||
/// Multiply with 0.5 to make color half as opaque.
|
||||
pub fn linear_multiply(self, factor: f32) -> Color32 {
|
||||
crate::ecolor_assert!(0.0 <= factor && factor <= 1.0);
|
||||
crate::ecolor_assert!((0.0..=1.0).contains(&factor));
|
||||
// As an unfortunate side-effect of using premultiplied alpha
|
||||
// we need a somewhat expensive conversion to linear space and back.
|
||||
Rgba::from(self).multiply(factor).into()
|
||||
|
|
|
@ -100,7 +100,7 @@ fn fast_round(r: f32) -> u8 {
|
|||
pub fn test_srgba_conversion() {
|
||||
for b in 0..=255 {
|
||||
let l = linear_f32_from_gamma_u8(b);
|
||||
assert!(0.0 <= l && l <= 1.0);
|
||||
assert!((0.0..=1.0).contains(&l));
|
||||
assert_eq!(gamma_u8_from_linear_f32(l), b);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -96,22 +96,22 @@ impl Rgba {
|
|||
}
|
||||
|
||||
pub fn from_luminance_alpha(l: f32, a: f32) -> Self {
|
||||
crate::ecolor_assert!(0.0 <= l && l <= 1.0);
|
||||
crate::ecolor_assert!(0.0 <= a && a <= 1.0);
|
||||
crate::ecolor_assert!((0.0..=1.0).contains(&l));
|
||||
crate::ecolor_assert!((0.0..=1.0).contains(&a));
|
||||
Self([l * a, l * a, l * a, a])
|
||||
}
|
||||
|
||||
/// Transparent black
|
||||
#[inline(always)]
|
||||
pub fn from_black_alpha(a: f32) -> Self {
|
||||
crate::ecolor_assert!(0.0 <= a && a <= 1.0);
|
||||
crate::ecolor_assert!((0.0..=1.0).contains(&a));
|
||||
Self([0.0, 0.0, 0.0, a])
|
||||
}
|
||||
|
||||
/// Transparent white
|
||||
#[inline(always)]
|
||||
pub fn from_white_alpha(a: f32) -> Self {
|
||||
crate::ecolor_assert!(0.0 <= a && a <= 1.0, "a: {}", a);
|
||||
crate::ecolor_assert!((0.0..=1.0).contains(&a), "a: {}", a);
|
||||
Self([a, a, a, a])
|
||||
}
|
||||
|
||||
|
|
|
@ -146,12 +146,11 @@ impl RotatingTriangle {
|
|||
),
|
||||
);
|
||||
gl.compile_shader(shader);
|
||||
if !gl.get_shader_compile_status(shader) {
|
||||
panic!(
|
||||
"Failed to compile custom_3d_glow: {}",
|
||||
gl.get_shader_info_log(shader)
|
||||
);
|
||||
}
|
||||
assert!(
|
||||
gl.get_shader_compile_status(shader),
|
||||
"Failed to compile custom_3d_glow: {}",
|
||||
gl.get_shader_info_log(shader)
|
||||
);
|
||||
gl.attach_shader(program, shader);
|
||||
shader
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue