From 3c655438e716c8fbbd6405f3297d91baf9063b0c Mon Sep 17 00:00:00 2001 From: Lucas Meurer Date: Sun, 29 Dec 2024 15:45:55 +0100 Subject: [PATCH] Fixes --- crates/eframe/src/epi.rs | 8 ++++---- crates/egui_demo_app/src/apps/image_viewer.rs | 3 ++- crates/egui_demo_app/src/lib.rs | 2 +- crates/egui_kittest/src/app_kind.rs | 2 +- crates/egui_kittest/src/builder.rs | 2 +- crates/egui_kittest/src/lib.rs | 2 +- 6 files changed, 10 insertions(+), 9 deletions(-) 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_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) {