From cda6355de23825c201d02e6062cb2dd414e98bf9 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 27 Oct 2019 17:35:37 +0300 Subject: simplify AssistCtx API We never actually use ability to create multiple actions out of a single context --- crates/ra_assists/src/assists/merge_match_arms.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'crates/ra_assists/src/assists/merge_match_arms.rs') diff --git a/crates/ra_assists/src/assists/merge_match_arms.rs b/crates/ra_assists/src/assists/merge_match_arms.rs index b0c4ee78b..e9f2cae91 100644 --- a/crates/ra_assists/src/assists/merge_match_arms.rs +++ b/crates/ra_assists/src/assists/merge_match_arms.rs @@ -26,7 +26,7 @@ use ra_syntax::ast::{AstNode, MatchArm}; // } // } // ``` -pub(crate) fn merge_match_arms(mut ctx: AssistCtx) -> Option { +pub(crate) fn merge_match_arms(ctx: AssistCtx) -> Option { let current_arm = ctx.find_node_at_offset::()?; // We check if the following match arm matches this one. We could, but don't, @@ -52,7 +52,7 @@ pub(crate) fn merge_match_arms(mut ctx: AssistCtx) -> Option bool { a.pats().any(|x| match x { ra_syntax::ast::Pat::PlaceholderPat(..) => true, @@ -80,9 +80,7 @@ pub(crate) fn merge_match_arms(mut ctx: AssistCtx) -> Option