From 76ab3c19d89d90069c479d6b4065009c498a465d Mon Sep 17 00:00:00 2001 From: Febriananda Wida Pramudita Date: Fri, 26 Apr 2024 14:25:51 +0700 Subject: [PATCH] refactor if into match --- src/matches.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/matches.rs b/src/matches.rs index 72ec10517d2c..86848c2cadc5 100644 --- a/src/matches.rs +++ b/src/matches.rs @@ -103,10 +103,9 @@ pub(crate) fn rewrite_match( let inner_attrs_str = if inner_attrs.is_empty() { String::new() } else { - let shape = if context.config.version() == Version::One { - shape - } else { - shape.block_indent(context.config.tab_spaces()) + let shape = match context.config.version() { + Version::One => shape, + _ => shape.block_indent(context.config.tab_spaces()) }; inner_attrs .rewrite(context, shape)