Replace remaining usages of finish_pending_tasks with condition

This commit is contained in:
Antonio Scandurra
2021-04-20 12:28:30 +02:00
parent ebb7124405
commit cd7dccd30c
4 changed files with 50 additions and 225 deletions
+4 -5
View File
@@ -106,11 +106,10 @@ impl Pane {
}
pub fn activate_entry(&mut self, entry_id: (usize, u64), ctx: &mut ViewContext<Self>) -> bool {
if let Some(index) = self
.items
.iter()
.position(|item| item.entry_id(ctx.as_ref()).map_or(false, |id| id == entry_id))
{
if let Some(index) = self.items.iter().position(|item| {
item.entry_id(ctx.as_ref())
.map_or(false, |id| id == entry_id)
}) {
self.activate_item(index, ctx);
true
} else {