File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -55,21 +55,20 @@ impl ObjectImpl for ConfiguratorAppInner {
55
55
56
56
impl ApplicationImpl for ConfiguratorAppInner {
57
57
fn handle_local_options ( & self , _app : & ConfiguratorApp , opts : & glib:: VariantDict ) -> i32 {
58
- let board_names = if let Some ( opt) = opts. lookup_value ( "fake-keyboard" , None ) {
59
- let value: String = opt. get ( ) . unwrap ( ) ;
58
+ fn lookup < T : glib:: FromVariant > ( opts : & glib:: VariantDict , key : & str ) -> Option < T > {
59
+ opts. lookup_value ( key, None ) ?. get ( )
60
+ }
60
61
61
- if & value == "all" {
62
- backend:: layouts ( ) . iter ( ) . map ( |s| s. to_string ( ) ) . collect ( )
63
- } else {
64
- value. split ( ',' ) . map ( str:: to_string) . collect ( )
65
- }
66
- } else {
67
- vec ! [ ]
62
+ let board_names = match lookup :: < String > ( opts, "fake-keyboard" ) . as_deref ( ) {
63
+ Some ( "all" ) => backend:: layouts ( ) . iter ( ) . map ( |s| s. to_string ( ) ) . collect ( ) ,
64
+ Some ( value) => value. split ( ',' ) . map ( str:: to_string) . collect ( ) ,
65
+ None => vec ! [ ] ,
68
66
} ;
69
67
70
68
self . phony_board_names . set ( board_names) ;
71
69
self . debug_layers . set ( opts. contains ( "debug-layers" ) ) ;
72
70
self . launch_test . set ( opts. contains ( "launch-test" ) ) ;
71
+
73
72
-1
74
73
}
75
74
You can’t perform that action at this time.
0 commit comments