From 64b91393b85eb2b5d41ccbd3048dcc61eb8061c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Wed, 17 Mar 2021 02:19:40 +0100 Subject: remove uselessly wrapped ?s. (clippy::meedless_question_mark let x = Some(3); let y = Some(x?); can just be: let y = x --- crates/hir_expand/src/lib.rs | 4 ++-- crates/proc_macro_api/src/process.rs | 2 +- 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( let single = skip_trivia_token(node.value.first_token()?, Direction::Next)? == skip_trivia_token(node.value.last_token()?, Direction::Prev)?; - Some(node.value.descendants().find_map(|it| { + node.value.descendants().find_map(|it| { let first = skip_trivia_token(it.first_token()?, Direction::Next)?; let first = ascend_call_token(db, &expansion, node.with_value(first))?; @@ -487,7 +487,7 @@ fn original_range_opt( } Some(first.with_value(first.value.text_range().cover(last.value.text_range()))) - })?) + }) } 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( req: Request, ) -> io::Result> { req.write(&mut writer)?; - Ok(Response::read(&mut reader)?) + Response::read(&mut reader) } 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( ) -> Result { let annotation = from_proto::annotation(&snap, code_lens)?; - Ok(to_proto::code_lens(&snap, snap.analysis.resolve_annotation(annotation)?)?) + to_proto::code_lens(&snap, snap.analysis.resolve_annotation(annotation)?) } pub(crate) fn handle_document_highlight( -- cgit v1.2.3