@@ -53,45 +53,44 @@ pub(super) fn handle_change(tile: &mut Tile, input: &str, id: Id) -> iced::Task<
5353 height : 55. + DEFAULT_WINDOW_HEIGHT ,
5454 } ,
5555 ) ;
56- } else {
57- if tile. query_lc == "67" {
58- tile. results = vec ! [ App :: new_builtin(
59- "67" ,
60- "" ,
61- "Easter egg" ,
62- AppCommand :: Function ( Function :: RandomVar ( 67 ) ) ,
63- ) ] ;
64- return window:: resize (
65- id,
66- iced:: Size {
67- width : WINDOW_WIDTH ,
68- height : 55. + DEFAULT_WINDOW_HEIGHT ,
69- } ,
70- ) ;
71- }
72- if tile. query_lc . ends_with ( "?" ) {
73- tile. results = vec ! [ App :: new_builtin(
74- & format!( "Search for: {}" , tile. query) ,
75- "" ,
76- "Web Search" ,
77- AppCommand :: Function ( Function :: GoogleSearch ( tile. query. clone( ) ) ) ,
78- ) ] ;
79- return window:: resize (
80- id,
81- iced:: Size :: new ( WINDOW_WIDTH , 55. + DEFAULT_WINDOW_HEIGHT ) ,
82- ) ;
83- } else if tile. query_lc == "cbhist" {
84- tile. page = Page :: ClipboardHistory
85- } else if tile. query_lc == "main" {
86- tile. page = Page :: Main
87- }
56+ }
57+ if tile. query_lc == "67" {
58+ tile. results = vec ! [ App :: new_builtin(
59+ "67" ,
60+ "" ,
61+ "Easter egg" ,
62+ AppCommand :: Function ( Function :: RandomVar ( 67 ) ) ,
63+ ) ] ;
64+ return window:: resize (
65+ id,
66+ iced:: Size {
67+ width : WINDOW_WIDTH ,
68+ height : 55. + DEFAULT_WINDOW_HEIGHT ,
69+ } ,
70+ ) ;
71+ }
72+ if tile. query_lc . ends_with ( '?' ) {
73+ tile. results = vec ! [ App :: new_builtin(
74+ & format!( "Search for: {}" , tile. query) ,
75+ "" ,
76+ "Web Search" ,
77+ AppCommand :: Function ( Function :: GoogleSearch ( tile. query. clone( ) ) ) ,
78+ ) ] ;
79+ return window:: resize (
80+ id,
81+ iced:: Size :: new ( WINDOW_WIDTH , 55. + DEFAULT_WINDOW_HEIGHT ) ,
82+ ) ;
83+ } else if tile. query_lc == "cbhist" {
84+ tile. page = Page :: ClipboardHistory ;
85+ } else if tile. query_lc == "main" {
86+ tile. page = Page :: Main ;
8887 }
8988 tile. handle_search_query_changed ( ) ;
9089
9190 if tile. results . is_empty ( )
9291 && let Some ( res) = Expr :: from_str ( & tile. query ) . ok ( )
9392 {
94- let res_string = res. eval ( ) . map ( |x| x. to_string ( ) ) . unwrap_or ( String :: new ( ) ) ;
93+ let res_string = res. eval ( ) . map_or ( String :: new ( ) , |x| x. to_string ( ) ) ;
9594 tile. results . push ( App :: new_builtin (
9695 RUSTCAST_DESC_NAME ,
9796 & res_string,
@@ -155,7 +154,7 @@ pub(super) fn handle_change(tile: &mut Tile, input: &str, id: Id) -> iced::Task<
155154 tile. results = tile
156155 . emoji_apps
157156 . search_prefix ( "" )
158- . map ( |x| x . to_owned ( ) )
157+ . map ( std :: borrow :: ToOwned :: to_owned)
159158 . collect ( ) ;
160159 }
161160
0 commit comments