about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFebriananda Wida Pramudita <febriananda.wida@ui.ac.id>2024-04-25 10:28:35 +0700
committerYacin Tmimi <yacintmimi@gmail.com>2024-04-26 07:21:32 -0600
commit1f806d979ae4d8a0711d64ec6922d2780547ddae (patch)
tree807e5adf2be5fd47b40fe9aeab2b9bb3f35368eb
parent23c11f3a081b92bb5ba32d89322941d1a15ffaf5 (diff)
downloadrust-1f806d979ae4d8a0711d64ec6922d2780547ddae.tar.gz
rust-1f806d979ae4d8a0711d64ec6922d2780547ddae.zip
Update src/matches.rs
Co-authored-by: Yacin Tmimi <yacintmimi@gmail.com>
-rw-r--r--src/matches.rs15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/matches.rs b/src/matches.rs
index e59413647a9..72ec10517d2 100644
--- a/src/matches.rs
+++ b/src/matches.rs
@@ -103,15 +103,14 @@ pub(crate) fn rewrite_match(
     let inner_attrs_str = if inner_attrs.is_empty() {
         String::new()
     } else {
-        if context.config.version() == Version::One {
-            inner_attrs
-                .rewrite(context, shape)
-                .map(|s| format!("{}{}\n", nested_indent_str, s))?
+        let shape = if context.config.version() == Version::One {
+            shape
         } else {
-            inner_attrs
-                .rewrite(context, shape.block_indent(context.config.tab_spaces()))
-                .map(|s| format!("{}{}\n", nested_indent_str, s))?
-        }
+            shape.block_indent(context.config.tab_spaces())
+        };
+        inner_attrs
+            .rewrite(context, shape)
+            .map(|s| format!("{}{}\n", nested_indent_str, s))?
     };
 
     let open_brace_pos = if inner_attrs.is_empty() {