Another batch of lint fixes (#36521)
- **Enable a bunch of extra lints** - **First batch of fixes** - **More fixes** Release Notes: - N/A
This commit is contained in:
parent
69b1c6d6f5
commit
6825715503
147 changed files with 788 additions and 1042 deletions
|
@ -236,7 +236,7 @@ impl TerminalPanel {
|
|||
) -> Result<Entity<Self>> {
|
||||
let mut terminal_panel = None;
|
||||
|
||||
match workspace
|
||||
if let Some((database_id, serialization_key)) = workspace
|
||||
.read_with(&cx, |workspace, _| {
|
||||
workspace
|
||||
.database_id()
|
||||
|
@ -244,34 +244,29 @@ impl TerminalPanel {
|
|||
})
|
||||
.ok()
|
||||
.flatten()
|
||||
&& let Some(serialized_panel) = cx
|
||||
.background_spawn(async move { KEY_VALUE_STORE.read_kvp(&serialization_key) })
|
||||
.await
|
||||
.log_err()
|
||||
.flatten()
|
||||
.map(|panel| serde_json::from_str::<SerializedTerminalPanel>(&panel))
|
||||
.transpose()
|
||||
.log_err()
|
||||
.flatten()
|
||||
&& let Ok(serialized) = workspace
|
||||
.update_in(&mut cx, |workspace, window, cx| {
|
||||
deserialize_terminal_panel(
|
||||
workspace.weak_handle(),
|
||||
workspace.project().clone(),
|
||||
database_id,
|
||||
serialized_panel,
|
||||
window,
|
||||
cx,
|
||||
)
|
||||
})?
|
||||
.await
|
||||
{
|
||||
Some((database_id, serialization_key)) => {
|
||||
if let Some(serialized_panel) = cx
|
||||
.background_spawn(async move { KEY_VALUE_STORE.read_kvp(&serialization_key) })
|
||||
.await
|
||||
.log_err()
|
||||
.flatten()
|
||||
.map(|panel| serde_json::from_str::<SerializedTerminalPanel>(&panel))
|
||||
.transpose()
|
||||
.log_err()
|
||||
.flatten()
|
||||
&& let Ok(serialized) = workspace
|
||||
.update_in(&mut cx, |workspace, window, cx| {
|
||||
deserialize_terminal_panel(
|
||||
workspace.weak_handle(),
|
||||
workspace.project().clone(),
|
||||
database_id,
|
||||
serialized_panel,
|
||||
window,
|
||||
cx,
|
||||
)
|
||||
})?
|
||||
.await
|
||||
{
|
||||
terminal_panel = Some(serialized);
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
terminal_panel = Some(serialized);
|
||||
}
|
||||
|
||||
let terminal_panel = if let Some(panel) = terminal_panel {
|
||||
|
@ -629,7 +624,7 @@ impl TerminalPanel {
|
|||
workspace
|
||||
.read(cx)
|
||||
.panes()
|
||||
.into_iter()
|
||||
.iter()
|
||||
.cloned()
|
||||
.flat_map(pane_terminal_views),
|
||||
)
|
||||
|
|
|
@ -1937,7 +1937,8 @@ impl SearchableItem for TerminalView {
|
|||
// Selection head might have a value if there's a selection that isn't
|
||||
// associated with a match. Therefore, if there are no matches, we should
|
||||
// report None, no matter the state of the terminal
|
||||
let res = if !matches.is_empty() {
|
||||
|
||||
if !matches.is_empty() {
|
||||
if let Some(selection_head) = self.terminal().read(cx).selection_head {
|
||||
// If selection head is contained in a match. Return that match
|
||||
match direction {
|
||||
|
@ -1977,9 +1978,7 @@ impl SearchableItem for TerminalView {
|
|||
}
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
res
|
||||
}
|
||||
}
|
||||
fn replace(
|
||||
&mut self,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue