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 {
676
676
self . compare_commits_popup . open ( param) ?;
677
677
}
678
678
StackablePopupOpen :: GotoLine => {
679
- self . goto_line_popup . open ( ) ? ;
679
+ self . goto_line_popup . open ( ) ;
680
680
}
681
681
}
682
682
@@ -892,7 +892,7 @@ impl App {
892
892
..params
893
893
} ,
894
894
) ,
895
- )
895
+ ) ;
896
896
}
897
897
flags. insert (
898
898
NeedsUpdate :: ALL | NeedsUpdate :: COMMANDS ,
Original file line number Diff line number Diff line change @@ -38,9 +38,8 @@ impl GotoLinePopup {
38
38
}
39
39
}
40
40
41
- pub fn open ( & mut self ) -> Result < ( ) > {
41
+ pub fn open ( & mut self ) {
42
42
self . visible = true ;
43
- Ok ( ( ) )
44
43
}
45
44
}
46
45
@@ -65,22 +64,22 @@ impl Component for GotoLinePopup {
65
64
if key_match ( key, self . key_config . keys . exit_popup ) {
66
65
self . visible = false ;
67
66
self . line . clear ( ) ;
68
- self . queue . push ( InternalEvent :: PopupStackPop )
67
+ self . queue . push ( InternalEvent :: PopupStackPop ) ;
69
68
} else if let KeyCode :: Char ( c) = key. code {
70
- if c. is_digit ( 10 ) {
69
+ if c. is_ascii_digit ( ) {
71
70
// I'd assume it's unusual for people to blame
72
71
// files with milions of lines
73
72
if self . line . len ( ) < 6 {
74
- self . line . push ( c)
73
+ self . line . push ( c) ;
75
74
}
76
75
}
77
- } else if let KeyCode :: Backspace = key . code {
76
+ } else if key . code == KeyCode :: Backspace {
78
77
self . line . pop ( ) ;
79
78
} else if key_match ( key, self . key_config . keys . enter ) {
80
79
self . visible = false ;
81
- if self . line . len ( ) > 0 {
80
+ if ! self . line . is_empty ( ) {
82
81
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" ) ,
84
83
) ) ;
85
84
}
86
85
self . queue . push ( InternalEvent :: PopupStackPop ) ;
You can’t perform that action at this time.
0 commit comments