From 1841a39f865b38041e84cd80840587dbe57d62c1 Mon Sep 17 00:00:00 2001 From: krk Date: Fri, 1 Nov 2019 16:58:09 +0100 Subject: Remove variable pat. --- crates/ra_assists/src/assists/early_return.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'crates') diff --git a/crates/ra_assists/src/assists/early_return.rs b/crates/ra_assists/src/assists/early_return.rs index 827170f8f..4322d3737 100644 --- a/crates/ra_assists/src/assists/early_return.rs +++ b/crates/ra_assists/src/assists/early_return.rs @@ -38,7 +38,6 @@ use crate::{ pub(crate) fn convert_to_guarded_return(ctx: AssistCtx) -> Option { let if_expr: ast::IfExpr = ctx.find_node_at_offset()?; let cond = if_expr.condition()?; - let pat = &cond.pat(); let expr = cond.expr()?; let then_block = if_expr.then_branch()?.block()?; if if_expr.else_branch().is_some() { @@ -79,7 +78,7 @@ pub(crate) fn convert_to_guarded_return(ctx: AssistCtx) -> Opt ctx.add_assist(AssistId("convert_to_guarded_return"), "convert to guarded return", |edit| { let if_indent_level = IndentLevel::from_node(&if_expr.syntax()); - let new_block = match pat { + let new_block = match cond.pat() { None => { // If. let early_expression = &(early_expression.to_owned() + ";"); -- cgit v1.2.3