diff --git a/crates/imaging/src/ui/adjust/hue_saturation.rs b/crates/imaging/src/ui/adjust/hue_saturation.rs index 44b03468d..b88761ab9 100644 --- a/crates/imaging/src/ui/adjust/hue_saturation.rs +++ b/crates/imaging/src/ui/adjust/hue_saturation.rs @@ -275,7 +275,7 @@ impl std::ops::Deref for HueSaturationOutput { } /// What a colour of the image becomes under a Hue/Saturation value; see [`HueSaturationEditor::adjusted`]. -pub type AdjustedFn = dyn Fn(&HueSaturation, Srgba) -> Srgba; +pub type AdjustedFn<'a> = dyn Fn(&HueSaturation, Srgba) -> Srgba + 'a; /// Hue/Saturation. /// @@ -303,7 +303,7 @@ pub type AdjustedFn = dyn Fn(&HueSaturation, Srgba) -> Srgba; pub struct HueSaturationEditor<'a> { label: Label, value: Bind<'a, HueSaturation>, - adjusted: Option<&'a AdjustedFn>, + adjusted: Option<&'a AdjustedFn<'a>>, range: Option>, context: AdjustContext, } @@ -317,7 +317,7 @@ impl<'a> HueSaturationEditor<'a> { /// What a colour of the image becomes under a value: the host runs its engine. The lower spectrum bar asks for 37 /// full hues under the shown value, each edited range's swatch for its centre colour under a value holding only /// that range, and Colorize's swatch for a mid grey under the shown value. Without it every colour stays as it is. - pub fn adjusted(mut self, adjusted: &'a AdjustedFn) -> Self { + pub fn adjusted(mut self, adjusted: &'a AdjustedFn<'a>) -> Self { self.adjusted = Some(adjusted); self } diff --git a/crates/ui-widgets/tests/it/pickers/swatch.rs b/crates/ui-widgets/tests/it/pickers/swatch.rs index cdcfc9df5..87f0104fc 100644 --- a/crates/ui-widgets/tests/it/pickers/swatch.rs +++ b/crates/ui-widgets/tests/it/pickers/swatch.rs @@ -2,7 +2,7 @@ use craft_theme::Srgba; use craft_ui::choice::{RadioGroup, Swatch, SwatchShape}; -use craft_ui::contract::{Bind, Props as _, Show as _, ShowContainer as _}; +use craft_ui::contract::{Bind, Show as _, ShowContainer as _}; use craft_ui::layout_components::Row; use craft_ui::testing::{Fixture, trial}; use egui::{Key, Modifiers, Shape, vec2};