diff options
author | Matthias Krüger <[email protected]> | 2021-03-17 01:19:40 +0000 |
---|---|---|
committer | Matthias Krüger <[email protected]> | 2021-03-17 01:19:40 +0000 |
commit | 64b91393b85eb2b5d41ccbd3048dcc61eb8061c7 (patch) | |
tree | 8b08f99b7b8377cb1658b5a9ff7c932b5de3bc14 /crates | |
parent | 048dad8c2e86006e53b3a134279729efb28b9e32 (diff) |
remove uselessly wrapped ?s. (clippy::meedless_question_mark
let x = Some(3);
let y = Some(x?);
can just be:
let y = x
Diffstat (limited to 'crates')
-rw-r--r-- | crates/hir_expand/src/lib.rs | 4 | ||||
-rw-r--r-- | crates/proc_macro_api/src/process.rs | 2 | ||||
-rw-r--r-- | crates/rust-analyzer/src/handlers.rs | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/crates/hir_expand/src/lib.rs b/crates/hir_expand/src/lib.rs index eee430af1..7532d00b8 100644 --- a/crates/hir_expand/src/lib.rs +++ b/crates/hir_expand/src/lib.rs | |||
@@ -475,7 +475,7 @@ fn original_range_opt( | |||
475 | let single = skip_trivia_token(node.value.first_token()?, Direction::Next)? | 475 | let single = skip_trivia_token(node.value.first_token()?, Direction::Next)? |
476 | == skip_trivia_token(node.value.last_token()?, Direction::Prev)?; | 476 | == skip_trivia_token(node.value.last_token()?, Direction::Prev)?; |
477 | 477 | ||
478 | Some(node.value.descendants().find_map(|it| { | 478 | node.value.descendants().find_map(|it| { |
479 | let first = skip_trivia_token(it.first_token()?, Direction::Next)?; | 479 | let first = skip_trivia_token(it.first_token()?, Direction::Next)?; |
480 | let first = ascend_call_token(db, &expansion, node.with_value(first))?; | 480 | let first = ascend_call_token(db, &expansion, node.with_value(first))?; |
481 | 481 | ||
@@ -487,7 +487,7 @@ fn original_range_opt( | |||
487 | } | 487 | } |
488 | 488 | ||
489 | Some(first.with_value(first.value.text_range().cover(last.value.text_range()))) | 489 | Some(first.with_value(first.value.text_range().cover(last.value.text_range()))) |
490 | })?) | 490 | }) |
491 | } | 491 | } |
492 | 492 | ||
493 | fn ascend_call_token( | 493 | fn ascend_call_token( |
diff --git a/crates/proc_macro_api/src/process.rs b/crates/proc_macro_api/src/process.rs index 3ce851fe8..30bb1b687 100644 --- a/crates/proc_macro_api/src/process.rs +++ b/crates/proc_macro_api/src/process.rs | |||
@@ -154,5 +154,5 @@ fn send_request( | |||
154 | req: Request, | 154 | req: Request, |
155 | ) -> io::Result<Option<Response>> { | 155 | ) -> io::Result<Option<Response>> { |
156 | req.write(&mut writer)?; | 156 | req.write(&mut writer)?; |
157 | Ok(Response::read(&mut reader)?) | 157 | Response::read(&mut reader) |
158 | } | 158 | } |
diff --git a/crates/rust-analyzer/src/handlers.rs b/crates/rust-analyzer/src/handlers.rs index 6fb7da79c..b6f484e51 100644 --- a/crates/rust-analyzer/src/handlers.rs +++ b/crates/rust-analyzer/src/handlers.rs | |||
@@ -1134,7 +1134,7 @@ pub(crate) fn handle_code_lens_resolve( | |||
1134 | ) -> Result<CodeLens> { | 1134 | ) -> Result<CodeLens> { |
1135 | let annotation = from_proto::annotation(&snap, code_lens)?; | 1135 | let annotation = from_proto::annotation(&snap, code_lens)?; |
1136 | 1136 | ||
1137 | Ok(to_proto::code_lens(&snap, snap.analysis.resolve_annotation(annotation)?)?) | 1137 | to_proto::code_lens(&snap, snap.analysis.resolve_annotation(annotation)?) |
1138 | } | 1138 | } |
1139 | 1139 | ||
1140 | pub(crate) fn handle_document_highlight( | 1140 | pub(crate) fn handle_document_highlight( |