remove soft index key exist validation as hashmap now always synced, panic on failure instead

This commit is contained in:
yggverse 2025-01-30 23:11:48 +02:00
parent 0c9fbbcd7f
commit d49dbf9c0d

View File

@ -359,16 +359,13 @@ impl Tab {
// @TODO other/child features.. // @TODO other/child features..
} }
/// Find `Item` by `TabPage` position in HashMap `index`
fn item(&self, page_position: Option<i32>) -> Option<Rc<Item>> { fn item(&self, page_position: Option<i32>) -> Option<Rc<Item>> {
if let Some(tab_page) = match page_position { match page_position {
Some(value) => Some(self.tab_view.nth_page(value)), Some(value) => Some(self.tab_view.nth_page(value)),
None => self.tab_view.selected_page(), None => self.tab_view.selected_page(),
} {
if let Some(item) = self.index.borrow().get(&tab_page) {
return Some(item.clone());
} }
} .map(|tab_page| self.index.borrow().get(&tab_page).unwrap().clone())
None
} }
} }