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_assists/src/introduce_variable.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ra_assists') diff --git a/crates/ra_assists/src/introduce_variable.rs b/crates/ra_assists/src/introduce_variable.rs index c937a816c..f587b4fe6 100644 --- a/crates/ra_assists/src/introduce_variable.rs +++ b/crates/ra_assists/src/introduce_variable.rs @@ -8,7 +8,7 @@ use ra_syntax::{ use crate::{AssistCtx, Assist}; -pub(crate) fn introduce_variable<'a>(ctx: AssistCtx) -> Option { +pub(crate) fn introduce_variable(ctx: AssistCtx) -> Option { let node = ctx.covering_node(); if !valid_covering_node(node) { return None; @@ -61,13 +61,13 @@ fn valid_covering_node(node: &SyntaxNode) -> bool { /// Check wether the node is a valid expression which can be extracted to a variable. /// In general that's true for any expression, but in some cases that would produce invalid code. fn valid_target_expr(node: &SyntaxNode) -> Option<&ast::Expr> { - return match node.kind() { + match node.kind() { PATH_EXPR => None, BREAK_EXPR => ast::BreakExpr::cast(node).and_then(|e| e.expr()), RETURN_EXPR => ast::ReturnExpr::cast(node).and_then(|e| e.expr()), LOOP_EXPR => ast::ReturnExpr::cast(node).and_then(|e| e.expr()), _ => ast::Expr::cast(node), - }; + } } /// Returns the syntax node which will follow the freshly introduced var -- cgit v1.2.3