Render: the radiance bound check uses a range, as clippy 1.97 asks (#6650)
`cargo clippy --workspace --all-targets -- -D warnings` fails on Rust 1.97: the reflection radiance bound in crates/render/src/raytrace/image.rs (#5494) trips `clippy::manual_range_contains` (`v < 0.0 || v > 1e12`). It now reads `!(0.0..=1e12).contains(&v)`. The two differ only for NaN, which the `is_finite` check in front of it already refuses, so nothing else changes. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -749,7 +749,7 @@ impl ImageTask {
|
||||
for _ in 0..repeats {
|
||||
self.pixel_radiance += radiance;
|
||||
if !self.pixel_radiance.is_finite()
|
||||
|| [self.pixel_radiance.x, self.pixel_radiance.y, self.pixel_radiance.z].into_iter().any(|v| v < 0.0 || v > 1e12)
|
||||
|| [self.pixel_radiance.x, self.pixel_radiance.y, self.pixel_radiance.z].into_iter().any(|v| !(0.0..=1e12).contains(&v))
|
||||
{
|
||||
return Err(invalid("reflection radiance exceeds finite transport bound"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user