Prepare to simplify

This commit is contained in:
Hanno Braun 2024-12-10 19:07:12 +01:00
parent 529068cec5
commit f444996598

View File

@ -23,7 +23,7 @@ impl OperationView {
} }
pub fn select_last(&mut self) { pub fn select_last(&mut self) {
let last_index = self.operations().len().saturating_sub(1); let last_index = self.last_index();
self.selected = Some(last_index); self.selected = Some(last_index);
} }
@ -49,4 +49,8 @@ impl OperationView {
.nth(selected) .nth(selected)
.map(|(op, _)| op) .map(|(op, _)| op)
} }
fn last_index(&self) -> usize {
self.operations().len().saturating_sub(1)
}
} }