Remove unnecessary calls to WeakViewHandle::upgrade
This commit is contained in:
@@ -187,17 +187,15 @@ impl PickerDelegate for ThemeSelectorDelegate {
|
||||
.await
|
||||
};
|
||||
|
||||
if let Some(this) = this.upgrade(&cx) {
|
||||
this.update(&mut cx, |this, cx| {
|
||||
let delegate = this.delegate_mut();
|
||||
delegate.matches = matches;
|
||||
delegate.selected_index = delegate
|
||||
.selected_index
|
||||
.min(delegate.matches.len().saturating_sub(1));
|
||||
delegate.show_selected_theme(cx);
|
||||
})
|
||||
.log_err();
|
||||
}
|
||||
this.update(&mut cx, |this, cx| {
|
||||
let delegate = this.delegate_mut();
|
||||
delegate.matches = matches;
|
||||
delegate.selected_index = delegate
|
||||
.selected_index
|
||||
.min(delegate.matches.len().saturating_sub(1));
|
||||
delegate.show_selected_theme(cx);
|
||||
})
|
||||
.log_err();
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user