File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -118,11 +118,7 @@ impl MainWindow {
118118 if let Some ( ( help_area, pane) ) = help_pane {
119119 let props = HelpPaneProps {
120120 border_style : help_style,
121- has_focus : if let Help = state. focussed {
122- true
123- } else {
124- false
125- } ,
121+ has_focus : matches ! ( state. focussed, Help ) ,
126122 } ;
127123 pane. render ( props, help_area, buf) ;
128124 }
@@ -136,11 +132,7 @@ impl MainWindow {
136132 marked,
137133 selected : state. selected ,
138134 border_style : entries_style,
139- is_focussed : if let Main = state. focussed {
140- true
141- } else {
142- false
143- } ,
135+ is_focussed : matches ! ( state. focussed, Main ) ,
144136 } ;
145137 self . entries_pane . render ( props, entries_area, buf) ;
146138
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ impl MarkPane {
105105 pub fn process_events ( mut self , key : Key ) -> Option < ( Self , Option < MarkMode > ) > {
106106 let action = None ;
107107 match key {
108- Ctrl ( 'r' ) => return self . prepare_deletion ( ) ,
108+ Ctrl ( 'r' ) => return Some ( self . prepare_deletion ( ) ) ,
109109 Char ( 'x' ) | Char ( 'd' ) | Char ( ' ' ) => {
110110 return self . remove_selected ( ) . map ( |s| ( s, action) )
111111 }
@@ -174,12 +174,12 @@ impl MarkPane {
174174 d. num_errors_during_deletion = num_errors;
175175 }
176176 }
177- fn prepare_deletion ( mut self ) -> Option < ( Self , Option < MarkMode > ) > {
177+ fn prepare_deletion ( mut self ) -> ( Self , Option < MarkMode > ) {
178178 for entry in self . marked . values_mut ( ) {
179179 entry. num_errors_during_deletion = 0 ;
180180 }
181181 self . selected = Some ( 0 ) ;
182- Some ( ( self , Some ( MarkMode :: Delete ) ) )
182+ ( self , Some ( MarkMode :: Delete ) )
183183 }
184184 fn remove_selected ( mut self ) -> Option < Self > {
185185 if let Some ( mut selected) = self . selected {
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ fn main() -> Result<()> {
2626 use crate :: interactive:: { Interaction , TerminalApp } ;
2727 use anyhow:: Context ;
2828 use crosstermion:: terminal:: { tui:: new_terminal, AlternateRawScreen } ;
29+
2930 let no_tty_msg = "Interactive mode requires a connected terminal" ;
3031 if atty:: isnt ( atty:: Stream :: Stdout ) {
3132 return Err ( anyhow ! ( no_tty_msg) ) ;
You can’t perform that action at this time.
0 commit comments