Enable clippy::await_holding_lock
(#9362)
This PR enables the [`clippy::await_holding_lock`](https://rust-lang.github.io/rust-clippy/master/index.html#/await_holding_lock) rule and fixes the outstanding violations. Release Notes: - N/A
This commit is contained in:
parent
b0ce25b67a
commit
7f3f296e81
2 changed files with 23 additions and 18 deletions
|
@ -406,7 +406,6 @@ style = "allow"
|
||||||
# Individual rules that have violations in the codebase:
|
# Individual rules that have violations in the codebase:
|
||||||
almost_complete_range = "allow"
|
almost_complete_range = "allow"
|
||||||
arc_with_non_send_sync = "allow"
|
arc_with_non_send_sync = "allow"
|
||||||
await_holding_lock = "allow"
|
|
||||||
borrowed_box = "allow"
|
borrowed_box = "allow"
|
||||||
derive_ord_xor_partial_ord = "allow"
|
derive_ord_xor_partial_ord = "allow"
|
||||||
eq_op = "allow"
|
eq_op = "allow"
|
||||||
|
|
|
@ -5235,6 +5235,7 @@ impl Project {
|
||||||
project_id.ok_or_else(|| anyhow!("Remote project without remote_id"))?;
|
project_id.ok_or_else(|| anyhow!("Remote project without remote_id"))?;
|
||||||
|
|
||||||
for completion_index in completion_indices {
|
for completion_index in completion_indices {
|
||||||
|
let (server_id, completion) = {
|
||||||
let completions_guard = completions.read();
|
let completions_guard = completions.read();
|
||||||
let completion = &completions_guard[completion_index];
|
let completion = &completions_guard[completion_index];
|
||||||
if completion.documentation.is_some() {
|
if completion.documentation.is_some() {
|
||||||
|
@ -5244,7 +5245,9 @@ impl Project {
|
||||||
did_resolve = true;
|
did_resolve = true;
|
||||||
let server_id = completion.server_id;
|
let server_id = completion.server_id;
|
||||||
let completion = completion.lsp_completion.clone();
|
let completion = completion.lsp_completion.clone();
|
||||||
drop(completions_guard);
|
|
||||||
|
(server_id, completion)
|
||||||
|
};
|
||||||
|
|
||||||
Self::resolve_completion_documentation_remote(
|
Self::resolve_completion_documentation_remote(
|
||||||
project_id,
|
project_id,
|
||||||
|
@ -5259,6 +5262,7 @@ impl Project {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for completion_index in completion_indices {
|
for completion_index in completion_indices {
|
||||||
|
let (server_id, completion) = {
|
||||||
let completions_guard = completions.read();
|
let completions_guard = completions.read();
|
||||||
let completion = &completions_guard[completion_index];
|
let completion = &completions_guard[completion_index];
|
||||||
if completion.documentation.is_some() {
|
if completion.documentation.is_some() {
|
||||||
|
@ -5267,7 +5271,9 @@ impl Project {
|
||||||
|
|
||||||
let server_id = completion.server_id;
|
let server_id = completion.server_id;
|
||||||
let completion = completion.lsp_completion.clone();
|
let completion = completion.lsp_completion.clone();
|
||||||
drop(completions_guard);
|
|
||||||
|
(server_id, completion)
|
||||||
|
};
|
||||||
|
|
||||||
let server = this
|
let server = this
|
||||||
.read_with(&mut cx, |project, _| {
|
.read_with(&mut cx, |project, _| {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue