cargo fmt
This commit is contained in:
parent
9815d4d981
commit
ab41b83cd8
3 changed files with 25 additions and 34 deletions
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<App: Application>(
|
||||
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<App::Message>>
|
||||
|
|
@ -45,12 +42,8 @@ pub fn app_window<App: Application>(
|
|||
) -> (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<dyn Fn(&mut App) -> window::Settings + Send + Sync + 'static> =
|
||||
Box::new(settings);
|
||||
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);
|
||||
Arc::new(boxed)
|
||||
}),
|
||||
)
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -70,22 +63,14 @@ pub fn app_window<App: Application>(
|
|||
#[cfg(all(feature = "wayland", feature = "winit"))]
|
||||
#[must_use]
|
||||
pub fn simple_window<Message: 'static>(
|
||||
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<Message>> + 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<dyn Fn() -> window::Settings + Send + Sync + 'static> = Box::new(settings);
|
||||
let boxed: Box<dyn Any + Send + Sync + 'static> = Box::new(boxed);
|
||||
|
||||
(
|
||||
|
|
@ -95,16 +80,18 @@ pub fn simple_window<Message: 'static>(
|
|||
Arc::new(boxed),
|
||||
view.map(|view| {
|
||||
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);
|
||||
let boxed: Box<dyn Any + Send + Sync + 'static> = Box::new(boxed);
|
||||
Arc::new(boxed)
|
||||
}),
|
||||
)
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
#[cfg(all(feature = "wayland", feature = "winit"))]
|
||||
#[must_use]
|
||||
pub fn app_popup<App: Application>(
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue