diff --git a/crates/eframe/src/epi.rs b/crates/eframe/src/epi.rs index a1906fd8479d..ee7d2d9c551f 100644 --- a/crates/eframe/src/epi.rs +++ b/crates/eframe/src/epi.rs @@ -691,7 +691,7 @@ impl Frame { wgpu_render_state: None, } } - + /// True if you are in a web environment. /// /// Equivalent to `cfg!(target_arch = "wasm32")` @@ -847,11 +847,11 @@ impl IntegrationInfo { host: "localhost".to_owned(), hostname: "localhost".to_owned(), port: "80".to_owned(), - hash: "".to_owned(), - query: "".to_owned(), + hash: String::new(), + query: String::new(), query_map: Default::default(), origin: "http://localhost".to_owned(), - } + }, }, cpu_usage: None, } diff --git a/crates/egui_demo_app/src/apps/image_viewer.rs b/crates/egui_demo_app/src/apps/image_viewer.rs index b756065c2622..3306d0e4f970 100644 --- a/crates/egui_demo_app/src/apps/image_viewer.rs +++ b/crates/egui_demo_app/src/apps/image_viewer.rs @@ -53,7 +53,8 @@ impl eframe::App for ImageViewer { egui::TopBottomPanel::new(TopBottomSide::Top, "url bar").show(ctx, |ui| { ui.horizontal_centered(|ui| { let label = ui.label("URI:"); - ui.text_edit_singleline(&mut self.uri_edit_text).labelled_by(label.id); + ui.text_edit_singleline(&mut self.uri_edit_text) + .labelled_by(label.id); if ui.small_button("✔").clicked() { ctx.forget_image(&self.current_uri); self.uri_edit_text = self.uri_edit_text.trim().to_owned(); diff --git a/crates/egui_demo_app/src/lib.rs b/crates/egui_demo_app/src/lib.rs index a251da252b78..0eb34486dd1e 100644 --- a/crates/egui_demo_app/src/lib.rs +++ b/crates/egui_demo_app/src/lib.rs @@ -6,7 +6,7 @@ mod backend_panel; mod frame_history; mod wrap_app; -pub use wrap_app::{WrapApp, Anchor}; +pub use wrap_app::{Anchor, WrapApp}; /// Time of day as seconds since midnight. Used for clock in demo app. pub(crate) fn seconds_since_midnight() -> f64 { diff --git a/crates/egui_demo_app/tests/test_demo_app.rs b/crates/egui_demo_app/tests/test_demo_app.rs index ea736a33730e..9675eebc31ad 100644 --- a/crates/egui_demo_app/tests/test_demo_app.rs +++ b/crates/egui_demo_app/tests/test_demo_app.rs @@ -1,5 +1,4 @@ use egui::accesskit::Role; -use egui::{Key, Modifiers}; use egui_demo_app::{Anchor, WrapApp}; use egui_kittest::kittest::Queryable; @@ -52,7 +51,7 @@ fn test_demo_app() { harness .get_by_role_and_label(Role::TextInput, "URI:") .focus(); - harness.press_key_modifiers(Modifiers::COMMAND, Key::A); + harness.press_key_modifiers(egui::Modifiers::COMMAND, egui::Key::A); harness .get_by_role_and_label(Role::TextInput, "URI:") @@ -65,15 +64,12 @@ fn test_demo_app() { harness.run(); - harness - .try_wgpu_snapshot(&anchor.to_string()) - .err() - .map(|e| { - results.push(e); - }); + if let Err(e) = harness.try_wgpu_snapshot(&anchor.to_string()) { + results.push(e); + } } - for error in results { + if let Some(error) = results.first() { panic!("{error}"); } } diff --git a/crates/egui_kittest/src/app_kind.rs b/crates/egui_kittest/src/app_kind.rs index e6bd319d8038..a854f45c6f0a 100644 --- a/crates/egui_kittest/src/app_kind.rs +++ b/crates/egui_kittest/src/app_kind.rs @@ -6,7 +6,7 @@ type AppKindContext<'a> = Box; type AppKindUi<'a> = Box; /// In order to access the [eframe::App] trait from the generic [State], we store a function pointer -/// here that will return the dyn trait from the struct. In the builder we have the correct where +/// here that will return the dyn trait from the struct. In the builder we have the correct where /// clause to be able to create this. /// Later we can use it anywhere to get the [eframe::App] from the [State]. #[cfg(feature = "eframe")] diff --git a/crates/egui_kittest/src/builder.rs b/crates/egui_kittest/src/builder.rs index 8367528e0b1c..891adbabce47 100644 --- a/crates/egui_kittest/src/builder.rs +++ b/crates/egui_kittest/src/builder.rs @@ -97,7 +97,7 @@ impl HarnessBuilder { ) -> Harness<'a, State> { Harness::from_builder(&self, AppKind::UiState(Box::new(app)), state, None) } - + /// Create a new [Harness] from the given eframe creation closure. /// The app can be accessed via the [Harness::state] / [Harness::state_mut] methods. #[cfg(feature = "eframe")] diff --git a/crates/egui_kittest/src/lib.rs b/crates/egui_kittest/src/lib.rs index 4739fe31c9d4..c47c90f746f5 100644 --- a/crates/egui_kittest/src/lib.rs +++ b/crates/egui_kittest/src/lib.rs @@ -278,7 +278,7 @@ impl<'a, State> Harness<'a, State> { physical_key: None, }); } - + /// Press a key with modifiers. /// This will create a key down event and a key up event. pub fn press_key_modifiers(&mut self, modifiers: Modifiers, key: egui::Key) {