fix: remove edge-case wrapping_add

left this on accident when I decided wrapping around isn't useful
(especially without it scrolling to show the selection)
This commit is contained in:
electria 2026-08-27 10:31:34 -07:00
commit 2b41e36362
Signed by: electria
SSH key fingerprint: SHA256:8LlB3ucPbBHqozqkhsNbaV5oG3SlzzqUj8FZDL6IPQs

View file

@ -127,12 +127,8 @@ impl State {
}
Message::SelectionLeft => self.selected_field.previous(),
Message::SelectionDown => {
self.selected_entry = if self.selected_entry == self.db_view.len() - 1 {
// essentially do a wrapping_add up to the highest index in the view
0
} else {
self.selected_entry =
(self.selected_entry.saturating_add(1)).clamp(0, self.db_view.len() - 1)
}
}
Message::SelectionUp => {
self.selected_entry =