File tree Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -676,7 +676,7 @@ impl App {
676676 self . compare_commits_popup . open ( param) ?;
677677 }
678678 StackablePopupOpen :: GotoLine => {
679- self . goto_line_popup . open ( ) ? ;
679+ self . goto_line_popup . open ( ) ;
680680 }
681681 }
682682
@@ -892,7 +892,7 @@ impl App {
892892 ..params
893893 } ,
894894 ) ,
895- )
895+ ) ;
896896 }
897897 flags. insert (
898898 NeedsUpdate :: ALL | NeedsUpdate :: COMMANDS ,
Original file line number Diff line number Diff line change @@ -38,9 +38,8 @@ impl GotoLinePopup {
3838 }
3939 }
4040
41- pub fn open ( & mut self ) -> Result < ( ) > {
41+ pub fn open ( & mut self ) {
4242 self . visible = true ;
43- Ok ( ( ) )
4443 }
4544}
4645
@@ -65,22 +64,22 @@ impl Component for GotoLinePopup {
6564 if key_match ( key, self . key_config . keys . exit_popup ) {
6665 self . visible = false ;
6766 self . line . clear ( ) ;
68- self . queue . push ( InternalEvent :: PopupStackPop )
67+ self . queue . push ( InternalEvent :: PopupStackPop ) ;
6968 } else if let KeyCode :: Char ( c) = key. code {
70- if c. is_digit ( 10 ) {
69+ if c. is_ascii_digit ( ) {
7170 // I'd assume it's unusual for people to blame
7271 // files with milions of lines
7372 if self . line . len ( ) < 6 {
74- self . line . push ( c)
73+ self . line . push ( c) ;
7574 }
7675 }
77- } else if let KeyCode :: Backspace = key . code {
76+ } else if key . code == KeyCode :: Backspace {
7877 self . line . pop ( ) ;
7978 } else if key_match ( key, self . key_config . keys . enter ) {
8079 self . visible = false ;
81- if self . line . len ( ) > 0 {
80+ if ! self . line . is_empty ( ) {
8281 self . queue . push ( InternalEvent :: GotoLine (
83- self . line . parse :: < usize > ( ) . unwrap ( ) ,
82+ self . line . parse :: < usize > ( ) . expect ( "This shouldn't happen since the input is constrained to ascii digits only" ) ,
8483 ) ) ;
8584 }
8685 self . queue . push ( InternalEvent :: PopupStackPop ) ;
You can’t perform that action at this time.
0 commit comments