From 6b79845431ba1f4e2643cd9bba6b9b52c7b3a65e Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Mon, 10 Nov 2025 21:49:31 +0100 Subject: [PATCH] Turn `HarnessBuilder::with_options` into a proper builder method (#7697) My bad when first creating it --- crates/egui_kittest/src/builder.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/egui_kittest/src/builder.rs b/crates/egui_kittest/src/builder.rs index cc686914f..09b91d26d 100644 --- a/crates/egui_kittest/src/builder.rs +++ b/crates/egui_kittest/src/builder.rs @@ -4,6 +4,7 @@ use egui::{Pos2, Rect, Vec2}; use std::marker::PhantomData; /// Builder for [`Harness`]. +#[must_use] pub struct HarnessBuilder { pub(crate) screen_rect: Rect, pub(crate) pixels_per_point: f32, @@ -64,8 +65,10 @@ impl HarnessBuilder { /// Set the default options used for snapshot tests on this harness. #[cfg(feature = "snapshot")] - pub fn with_options(&mut self, options: crate::SnapshotOptions) { + #[inline] + pub fn with_options(mut self, options: crate::SnapshotOptions) -> Self { self.default_snapshot_options = options; + self } /// Override the [`egui::os::OperatingSystem`] reported to egui.