From ab41b83cd8715268ce5703ce99f64fe2e9c5dff8 Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Wed, 24 Sep 2025 17:52:03 -0400 Subject: [PATCH] cargo fmt --- src/core.rs | 2 +- src/surface/action.rs | 35 +++++++++++------------------------ src/surface/mod.rs | 22 +++++++++++++--------- 3 files changed, 25 insertions(+), 34 deletions(-) diff --git a/src/core.rs b/src/core.rs index 6069a83..2e4e049 100644 --- a/src/core.rs +++ b/src/core.rs @@ -158,7 +158,7 @@ impl Default for Core { exit_on_main_window_closed: true, menu_bars: HashMap::new(), #[cfg(feature = "wayland")] - sync_window_border_radii_to_theme: true + sync_window_border_radii_to_theme: true, } } } diff --git a/src/surface/action.rs b/src/surface/action.rs index 25c45ce..3a078ca 100644 --- a/src/surface/action.rs +++ b/src/surface/action.rs @@ -30,10 +30,7 @@ pub fn destroy_window(id: iced_core::window::Id) -> Action { #[cfg(all(feature = "wayland", feature = "winit"))] #[must_use] pub fn app_window( - settings: impl Fn(&mut App) -> window::Settings - + Send - + Sync - + 'static, + settings: impl Fn(&mut App) -> window::Settings + Send + Sync + 'static, view: Option< Box< dyn for<'a> Fn(&'a App) -> crate::Element<'a, crate::Action> @@ -45,12 +42,8 @@ pub fn app_window( ) -> (window::Id, Action) { let id = window::Id::unique(); - let boxed: Box< - dyn Fn(&mut App) -> window::Settings - + Send - + Sync - + 'static, - > = Box::new(settings); + let boxed: Box window::Settings + Send + Sync + 'static> = + Box::new(settings); let boxed: Box = Box::new(boxed); ( @@ -62,7 +55,7 @@ pub fn app_window( let boxed: Box = Box::new(view); Arc::new(boxed) }), - ) + ), ) } @@ -70,22 +63,14 @@ pub fn app_window( #[cfg(all(feature = "wayland", feature = "winit"))] #[must_use] pub fn simple_window( - settings: impl Fn() -> window::Settings - + Send - + Sync - + 'static, + settings: impl Fn() -> window::Settings + Send + Sync + 'static, view: Option< impl Fn() -> crate::Element<'static, crate::Action> + Send + Sync + 'static, >, ) -> (window::Id, Action) { let id = window::Id::unique(); - let boxed: Box< - dyn Fn() -> window::Settings - + Send - + Sync - + 'static, - > = Box::new(settings); + let boxed: Box window::Settings + Send + Sync + 'static> = Box::new(settings); let boxed: Box = Box::new(boxed); ( @@ -95,16 +80,18 @@ pub fn simple_window( Arc::new(boxed), view.map(|view| { let boxed: Box< - dyn Fn() -> crate::Element<'static, crate::Action> + Send + Sync + 'static, + dyn Fn() -> crate::Element<'static, crate::Action> + + Send + + Sync + + 'static, > = Box::new(view); let boxed: Box = Box::new(boxed); Arc::new(boxed) }), - ) + ), ) } - #[cfg(all(feature = "wayland", feature = "winit"))] #[must_use] pub fn app_popup( diff --git a/src/surface/mod.rs b/src/surface/mod.rs index b4ef63b..4598ac7 100644 --- a/src/surface/mod.rs +++ b/src/surface/mod.rs @@ -96,15 +96,19 @@ impl std::fmt::Debug for Action { .field("size", size) .finish(), Self::Ignore => write!(f, "Ignore"), - Self::AppWindow(id, arg0, arg1) => { - f.debug_tuple("AppWindow").field(id).field(arg0).field(arg1).finish() - } - Self::Window(id, arg0, arg1) => { - f.debug_tuple("Window").field(id).field(arg0).field(arg1).finish() - } - Self::DestroyWindow(arg0) => { - f.debug_tuple("DestroyWindow").field(arg0).finish() - } + Self::AppWindow(id, arg0, arg1) => f + .debug_tuple("AppWindow") + .field(id) + .field(arg0) + .field(arg1) + .finish(), + Self::Window(id, arg0, arg1) => f + .debug_tuple("Window") + .field(id) + .field(arg0) + .field(arg1) + .finish(), + Self::DestroyWindow(arg0) => f.debug_tuple("DestroyWindow").field(arg0).finish(), Self::Task(_) => f.debug_tuple("Future").finish(), } }