mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-17 02:54:25 +00:00
Lints: keep the sizing story closures
This commit is contained in:
@@ -9,12 +9,14 @@ use egui::Ui;
|
||||
const PICTURE: PixelSize = PixelSize::new(1600, 900);
|
||||
|
||||
#[story(ImageSize<'static>, covers = [], drive = Drive::Never)]
|
||||
#[expect(clippy::redundant_closure, reason = "`ImageSize::new` as a function item is not general over the borrow the host passes")]
|
||||
fn image_size(ui: &mut Ui, data: &mut StoryData) -> StoryOutput {
|
||||
let resample = *data.value("resample", true);
|
||||
hosted(ui, data, resample, || HostedImageSize::new(ImageSizeValues::new(PICTURE).resampling(resample), ImageSize::new))
|
||||
hosted(ui, data, resample, || HostedImageSize::new(ImageSizeValues::new(PICTURE).resampling(resample), |values| ImageSize::new(values)))
|
||||
}
|
||||
|
||||
#[story(CanvasSize<'static>, covers = [], drive = Drive::Never)]
|
||||
#[expect(clippy::redundant_closure, reason = "`CanvasSize::new` as a function item is not general over the borrow the host passes")]
|
||||
fn canvas_size(ui: &mut Ui, data: &mut StoryData) -> StoryOutput {
|
||||
hosted(ui, data, (), || HostedCanvasSize::new(CanvasSizeValues::new(PICTURE), CanvasSize::new))
|
||||
hosted(ui, data, (), || HostedCanvasSize::new(CanvasSizeValues::new(PICTURE), |values| CanvasSize::new(values)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user