Avoid optional on select_match

This commit is contained in:
Conrad Irwin 2023-07-17 12:02:10 -06:00
parent f887a17ffe
commit c9bf407431
6 changed files with 80 additions and 114 deletions

View file

@ -330,13 +330,13 @@ impl AssistantPanel {
fn select_next_match(&mut self, _: &search::SelectNextMatch, cx: &mut ViewContext<Self>) {
if let Some(search_bar) = self.toolbar.read(cx).item_of_type::<BufferSearchBar>() {
search_bar.update(cx, |bar, cx| bar.select_match(Direction::Next, None, cx));
search_bar.update(cx, |bar, cx| bar.select_match(Direction::Next, 1, cx));
}
}
fn select_prev_match(&mut self, _: &search::SelectPrevMatch, cx: &mut ViewContext<Self>) {
if let Some(search_bar) = self.toolbar.read(cx).item_of_type::<BufferSearchBar>() {
search_bar.update(cx, |bar, cx| bar.select_match(Direction::Prev, None, cx));
search_bar.update(cx, |bar, cx| bar.select_match(Direction::Prev, 1, cx));
}
}