File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ macro_rules! keyboards {
34
34
}
35
35
}
36
36
37
- pub fn layouts( ) -> & ' static [ & ' static str ] {
37
+ pub ( super ) fn layouts( ) -> & ' static [ & ' static str ] {
38
38
& [ $( $board ) ,* ]
39
39
}
40
40
} ;
Original file line number Diff line number Diff line change @@ -69,7 +69,8 @@ fn main_app(app: >k::Application, daemon: Rc<dyn Daemon>) {
69
69
if count == 0 {
70
70
eprintln ! ( "Failed to locate any keyboards, showing demo" ) ;
71
71
72
- let daemon = Rc :: new ( DaemonDummy :: new ( ) ) ;
72
+ let board_names = layout:: layouts ( ) . iter ( ) . map ( |s| s. to_string ( ) ) . collect ( ) ;
73
+ let daemon = Rc :: new ( DaemonDummy :: new ( board_names) ) ;
73
74
let boards = daemon. boards ( ) . unwrap ( ) ;
74
75
75
76
for ( i, board) in boards. iter ( ) . enumerate ( ) {
Original file line number Diff line number Diff line change @@ -29,8 +29,7 @@ impl DaemonDummy {
29
29
}
30
30
31
31
impl DaemonDummy {
32
- pub fn new ( ) -> Self {
33
- let board_names: Vec < _ > = layout:: layouts ( ) . iter ( ) . map ( |s| s. to_string ( ) ) . collect ( ) ;
32
+ pub fn new ( board_names : Vec < String > ) -> Self {
34
33
let boards = board_names. iter ( ) . map ( |_| BoardDummy :: default ( ) ) . collect ( ) ;
35
34
Self {
36
35
board_names,
@@ -80,4 +79,4 @@ impl Daemon for DaemonDummy {
80
79
fn exit ( & self ) -> Result < ( ) , String > {
81
80
Ok ( ( ) )
82
81
}
83
- }
82
+ }
You can’t perform that action at this time.
0 commit comments