From 70e8121a2a16420feb984e11e5aa9ed45ba286a0 Mon Sep 17 00:00:00 2001 From: Reinout Meliesie Date: Mon, 23 Dec 2024 23:41:08 +0100 Subject: [PATCH] Formatting in collation_menu --- src/ui/collation_menu.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/ui/collation_menu.rs b/src/ui/collation_menu.rs index 64c7839..dfe3c36 100644 --- a/src/ui/collation_menu.rs +++ b/src/ui/collation_menu.rs @@ -16,8 +16,7 @@ pub struct FilmCollationMenu { widget : Box } pub struct SeriesCollationMenu { widget : Box } impl FilmCollationMenu { - pub fn new ( on_sort : F ) -> Self - where F : Fn (FilmsSortedBy) + 'static { + pub fn new < F : Fn (FilmsSortedBy) + 'static > ( on_sort : F ) -> Self { let widget = Box :: builder () . orientation (Horizontal) . halign (Center) @@ -62,8 +61,7 @@ fn create_sort_button ( sort_menu : & Popover ) -> SplitButton { . build () } -fn create_films_sort_menu ( on_sort : F ) -> Popover -where F : Fn (FilmsSortedBy) + 'static { +fn create_films_sort_menu < F : Fn (FilmsSortedBy) + 'static > ( on_sort : F ) -> Popover { let container = ListBox :: new () ; container . append ( & create_sort_menu_entry ( "Name" , false , true ) ) ; @@ -84,8 +82,7 @@ where F : Fn (FilmsSortedBy) + 'static { . css_classes ( ["menu"] ) . build () } -fn create_series_sort_menu ( on_sort : F ) -> Popover -where F : Fn (SeriesSortedBy) + 'static { +fn create_series_sort_menu < F : Fn (SeriesSortedBy) + 'static > ( on_sort : F ) -> Popover { let container = ListBox :: new () ; container . append ( & create_sort_menu_entry ( "Name" , false , true ) ) ; @@ -105,9 +102,7 @@ where F : Fn (SeriesSortedBy) + 'static { . build () } -fn create_sort_menu_entry ( - label : & str , reverse : bool , selected : bool , -) -> ListBoxRow { +fn create_sort_menu_entry ( label : & str , reverse : bool , selected : bool ) -> ListBoxRow { let icon = match reverse { false => Image :: from_icon_name ("view-sort-ascending-symbolic") , true => Image :: from_icon_name ("view-sort-descending-symbolic") ,