remove uselessly wrapped ?s. (clippy::meedless_question_mark

let x = Some(3);

let y = Some(x?);
can just be:
let y = x
This commit is contained in:
Matthias Krüger 2021-03-17 02:19:40 +01:00
parent 048dad8c2e
commit 64b91393b8
3 changed files with 4 additions and 4 deletions

View File

@ -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(

View File

@ -154,5 +154,5 @@ fn send_request(
req: Request,
) -> io::Result<Option<Response>> {
req.write(&mut writer)?;
Ok(Response::read(&mut reader)?)
Response::read(&mut reader)
}

View File

@ -1134,7 +1134,7 @@ pub(crate) fn handle_code_lens_resolve(
) -> Result<CodeLens> {
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(