From 6753051a45e067fb8267f7ecbbf1b894558718d1 Mon Sep 17 00:00:00 2001 From: kjeremy Date: Wed, 6 Feb 2019 15:50:26 -0500 Subject: Some clippy cleanups --- crates/ra_lsp_server/src/main_loop/handlers.rs | 34 ++++++++++++-------------- 1 file changed, 15 insertions(+), 19 deletions(-) (limited to 'crates/ra_lsp_server/src/main_loop') diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index ab2b81bf0..aa55d1255 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs @@ -123,7 +123,7 @@ pub fn handle_on_type_formatting( let edit = edit.source_file_edits.pop().unwrap(); let change: Vec = edit.edit.conv_with(&line_index); - return Ok(Some(change)); + Ok(Some(change)) } pub fn handle_document_symbol( @@ -319,7 +319,7 @@ pub fn handle_runnables( args: check_args, env: FxHashMap::default(), }); - return Ok(res); + Ok(res) } pub fn handle_decorations( @@ -622,10 +622,8 @@ pub fn handle_code_lens( // Gather runnables for runnable in world.analysis().runnables(file_id)? { let title = match &runnable.kind { - RunnableKind::Test { name: _ } | RunnableKind::TestMod { path: _ } => { - Some("▶️Run Test") - } - RunnableKind::Bench { name: _ } => Some("Run Bench"), + RunnableKind::Test { .. } | RunnableKind::TestMod { .. } => Some("▶️Run Test"), + RunnableKind::Bench { .. } => Some("Run Bench"), _ => None, }; @@ -679,7 +677,7 @@ pub fn handle_code_lens( }), ); - return Ok(Some(lenses)); + Ok(Some(lenses)) } #[derive(Debug, Serialize, Deserialize)] @@ -722,22 +720,20 @@ pub fn handle_code_lens_resolve(world: ServerWorld, code_lens: CodeLens) -> Resu to_value(locations).unwrap(), ]), }; - return Ok(CodeLens { + Ok(CodeLens { range: code_lens.range, command: Some(cmd), data: None, - }); - } - None => { - return Ok(CodeLens { - range: code_lens.range, - command: Some(Command { - title: "Error".into(), - ..Default::default() - }), - data: None, - }); + }) } + None => Ok(CodeLens { + range: code_lens.range, + command: Some(Command { + title: "Error".into(), + ..Default::default() + }), + data: None, + }), } } -- cgit v1.2.3