Skip to content

Commit 9c526de

Browse files
andrea-berlingextrawurst
authored andcommitted
Fix make check errors
1 parent 5f29d2f commit 9c526de

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

src/app.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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,

src/popups/goto_line.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)