cargo fmt

This commit is contained in:
Ashley Wulber 2025-09-24 17:52:03 -04:00 committed by Ashley Wulber
parent 9815d4d981
commit ab41b83cd8
3 changed files with 25 additions and 34 deletions

View file

@ -158,7 +158,7 @@ impl Default for Core {
exit_on_main_window_closed: true, exit_on_main_window_closed: true,
menu_bars: HashMap::new(), menu_bars: HashMap::new(),
#[cfg(feature = "wayland")] #[cfg(feature = "wayland")]
sync_window_border_radii_to_theme: true sync_window_border_radii_to_theme: true,
} }
} }
} }

View file

@ -30,10 +30,7 @@ pub fn destroy_window(id: iced_core::window::Id) -> Action {
#[cfg(all(feature = "wayland", feature = "winit"))] #[cfg(all(feature = "wayland", feature = "winit"))]
#[must_use] #[must_use]
pub fn app_window<App: Application>( pub fn app_window<App: Application>(
settings: impl Fn(&mut App) -> window::Settings settings: impl Fn(&mut App) -> window::Settings + Send + Sync + 'static,
+ Send
+ Sync
+ 'static,
view: Option< view: Option<
Box< Box<
dyn for<'a> Fn(&'a App) -> crate::Element<'a, crate::Action<App::Message>> dyn for<'a> Fn(&'a App) -> crate::Element<'a, crate::Action<App::Message>>
@ -45,12 +42,8 @@ pub fn app_window<App: Application>(
) -> (window::Id, Action) { ) -> (window::Id, Action) {
let id = window::Id::unique(); let id = window::Id::unique();
let boxed: Box< let boxed: Box<dyn Fn(&mut App) -> window::Settings + Send + Sync + 'static> =
dyn Fn(&mut App) -> window::Settings Box::new(settings);
+ Send
+ Sync
+ 'static,
> = Box::new(settings);
let boxed: Box<dyn Any + Send + Sync + 'static> = Box::new(boxed); let boxed: Box<dyn Any + Send + Sync + 'static> = Box::new(boxed);
( (
@ -62,7 +55,7 @@ pub fn app_window<App: Application>(
let boxed: Box<dyn Any + Send + Sync + 'static> = Box::new(view); let boxed: Box<dyn Any + Send + Sync + 'static> = Box::new(view);
Arc::new(boxed) Arc::new(boxed)
}), }),
) ),
) )
} }
@ -70,22 +63,14 @@ pub fn app_window<App: Application>(
#[cfg(all(feature = "wayland", feature = "winit"))] #[cfg(all(feature = "wayland", feature = "winit"))]
#[must_use] #[must_use]
pub fn simple_window<Message: 'static>( pub fn simple_window<Message: 'static>(
settings: impl Fn() -> window::Settings settings: impl Fn() -> window::Settings + Send + Sync + 'static,
+ Send
+ Sync
+ 'static,
view: Option< view: Option<
impl Fn() -> crate::Element<'static, crate::Action<Message>> + Send + Sync + 'static, impl Fn() -> crate::Element<'static, crate::Action<Message>> + Send + Sync + 'static,
>, >,
) -> (window::Id, Action) { ) -> (window::Id, Action) {
let id = window::Id::unique(); let id = window::Id::unique();
let boxed: Box< let boxed: Box<dyn Fn() -> window::Settings + Send + Sync + 'static> = Box::new(settings);
dyn Fn() -> window::Settings
+ Send
+ Sync
+ 'static,
> = Box::new(settings);
let boxed: Box<dyn Any + Send + Sync + 'static> = Box::new(boxed); let boxed: Box<dyn Any + Send + Sync + 'static> = Box::new(boxed);
( (
@ -95,16 +80,18 @@ pub fn simple_window<Message: 'static>(
Arc::new(boxed), Arc::new(boxed),
view.map(|view| { view.map(|view| {
let boxed: Box< let boxed: Box<
dyn Fn() -> crate::Element<'static, crate::Action<Message>> + Send + Sync + 'static, dyn Fn() -> crate::Element<'static, crate::Action<Message>>
+ Send
+ Sync
+ 'static,
> = Box::new(view); > = Box::new(view);
let boxed: Box<dyn Any + Send + Sync + 'static> = Box::new(boxed); let boxed: Box<dyn Any + Send + Sync + 'static> = Box::new(boxed);
Arc::new(boxed) Arc::new(boxed)
}), }),
) ),
) )
} }
#[cfg(all(feature = "wayland", feature = "winit"))] #[cfg(all(feature = "wayland", feature = "winit"))]
#[must_use] #[must_use]
pub fn app_popup<App: Application>( pub fn app_popup<App: Application>(

View file

@ -96,15 +96,19 @@ impl std::fmt::Debug for Action {
.field("size", size) .field("size", size)
.finish(), .finish(),
Self::Ignore => write!(f, "Ignore"), Self::Ignore => write!(f, "Ignore"),
Self::AppWindow(id, arg0, arg1) => { Self::AppWindow(id, arg0, arg1) => f
f.debug_tuple("AppWindow").field(id).field(arg0).field(arg1).finish() .debug_tuple("AppWindow")
} .field(id)
Self::Window(id, arg0, arg1) => { .field(arg0)
f.debug_tuple("Window").field(id).field(arg0).field(arg1).finish() .field(arg1)
} .finish(),
Self::DestroyWindow(arg0) => { Self::Window(id, arg0, arg1) => f
f.debug_tuple("DestroyWindow").field(arg0).finish() .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(), Self::Task(_) => f.debug_tuple("Future").finish(),
} }
} }