about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorFebriananda Wida Pramudita <febriananda.p@grabtaxi.com>2024-04-26 14:25:51 +0700
committerYacin Tmimi <yacintmimi@gmail.com>2024-04-26 07:21:32 -0600
commit76ab3c19d89d90069c479d6b4065009c498a465d (patch)
treef70fe0f7ab1d7072a2c2e7f6198ff5e116cd5a51 /src
parent1f806d979ae4d8a0711d64ec6922d2780547ddae (diff)
downloadrust-76ab3c19d89d90069c479d6b4065009c498a465d.tar.gz
rust-76ab3c19d89d90069c479d6b4065009c498a465d.zip
refactor if into match
Diffstat (limited to 'src')
-rw-r--r--src/matches.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/matches.rs b/src/matches.rs
index 72ec10517d2..86848c2cadc 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)