Upgrade to the Rust 2024 edition (#2367)

* Update to rust 2024 edition

* Fixes

* Clean up imports

* Cargo fmt again

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Dennis Kobert
2025-03-12 17:29:12 -07:00
committed by GitHub
co-authored by Keavon Chambers
parent 927d7dd9b2
commit beb1c6ae64
253 changed files with 980 additions and 1371 deletions
+4 -10
View File
@@ -6,15 +6,13 @@ use crate::raster::curve::{Curve, CurveManipulatorGroup, ValueMapperNode};
use crate::raster::image::{Image, ImageFrameTable};
use crate::raster::{Channel, Color, Pixel};
use crate::registry::types::{Angle, Percentage, SignedPercentage};
use crate::vector::style::GradientStops;
use crate::vector::VectorDataTable;
use crate::vector::style::GradientStops;
use crate::{Ctx, Node};
use crate::{GraphicElement, GraphicGroupTable};
use dyn_any::DynAny;
use core::cmp::Ordering;
use core::fmt::Debug;
use dyn_any::DynAny;
#[cfg(feature = "serde")]
#[cfg(target_arch = "spirv")]
use spirv_std::num_traits::float::Float;
@@ -574,11 +572,7 @@ async fn threshold<T: Adjust<Color>>(
LuminanceCalculation::MaximumChannels => color.maximum_rgb_channels(),
};
if luminance >= min_luminance && luminance <= max_luminance {
Color::WHITE
} else {
Color::BLACK
}
if luminance >= min_luminance && luminance <= max_luminance { Color::WHITE } else { Color::BLACK }
});
image
}
@@ -720,7 +714,7 @@ impl Adjust<Color> for Color {
}
impl Adjust<Color> for Option<Color> {
fn adjust(&mut self, map_fn: impl Fn(&Color) -> Color) {
if let Some(ref mut v) = self {
if let Some(v) = self {
*v = map_fn(v)
}
}