Apply suggestions from code review

Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>
This commit is contained in:
Jeevitha Kannan K S 2024-11-22 06:18:54 +05:30 committed by GitHub
parent c8dd5c779c
commit c6d3671d57
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -596,13 +596,13 @@ impl AppState {
}
fn scroll_down(&mut self) {
let entries = if self.at_root() {
let num_entries = if self.at_root() {
self.filter.item_list().len() - 1
} else {
self.filter.item_list().len()
};
if let Some(selected) = self.selection.selected() {
if selected == entries {
if selected == num_entries {
self.selection.select_first();
} else {
self.selection.select_next();