Replace IIFE with maybe!
(#6909)
This PR replaces a usage of an IIFE with `maybe!`. Release Notes: - N/A
This commit is contained in:
parent
bbdf401a78
commit
ff76b2ec4d
1 changed files with 3 additions and 2 deletions
|
@ -11,6 +11,7 @@ use lsp::IoKind;
|
||||||
use project::{search::SearchQuery, Project};
|
use project::{search::SearchQuery, Project};
|
||||||
use std::{borrow::Cow, sync::Arc};
|
use std::{borrow::Cow, sync::Arc};
|
||||||
use ui::{popover_menu, prelude::*, Button, Checkbox, ContextMenu, Label, Selection};
|
use ui::{popover_menu, prelude::*, Button, Checkbox, ContextMenu, Label, Selection};
|
||||||
|
use util::maybe;
|
||||||
use workspace::{
|
use workspace::{
|
||||||
item::{Item, ItemHandle},
|
item::{Item, ItemHandle},
|
||||||
searchable::{SearchEvent, SearchableItem, SearchableItemHandle},
|
searchable::{SearchEvent, SearchableItem, SearchableItemHandle},
|
||||||
|
@ -362,7 +363,7 @@ impl LspLogView {
|
||||||
.get(&project.downgrade())
|
.get(&project.downgrade())
|
||||||
.and_then(|project| project.servers.keys().copied().next());
|
.and_then(|project| project.servers.keys().copied().next());
|
||||||
let model_changes_subscription = cx.observe(&log_store, |this, store, cx| {
|
let model_changes_subscription = cx.observe(&log_store, |this, store, cx| {
|
||||||
(|| -> Option<()> {
|
maybe!({
|
||||||
let project_state = store.read(cx).projects.get(&this.project.downgrade())?;
|
let project_state = store.read(cx).projects.get(&this.project.downgrade())?;
|
||||||
if let Some(current_lsp) = this.current_server_id {
|
if let Some(current_lsp) = this.current_server_id {
|
||||||
if !project_state.servers.contains_key(¤t_lsp) {
|
if !project_state.servers.contains_key(¤t_lsp) {
|
||||||
|
@ -393,7 +394,7 @@ impl LspLogView {
|
||||||
}
|
}
|
||||||
|
|
||||||
Some(())
|
Some(())
|
||||||
})();
|
});
|
||||||
|
|
||||||
cx.notify();
|
cx.notify();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue