about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFebriananda Wida Pramudita <febriananda.p@grabtaxi.com>2024-04-13 21:11:43 +0700
committerYacin Tmimi <yacintmimi@gmail.com>2024-04-26 07:21:32 -0600
commit22a4306a7eadcf27e3957a66e6e596890d92c372 (patch)
tree5865905c56e82dc226c462cf8ea5af41d4ed16f0
parent4b1596f8a12f669990721efe5ba4b31a75b75c6f (diff)
downloadrust-22a4306a7eadcf27e3957a66e6e596890d92c372.tar.gz
rust-22a4306a7eadcf27e3957a66e6e596890d92c372.zip
fix the logic
-rw-r--r--src/matches.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/matches.rs b/src/matches.rs
index 06e7078b11f..48fc680a1b3 100644
--- a/src/matches.rs
+++ b/src/matches.rs
@@ -103,9 +103,12 @@ pub(crate) fn rewrite_match(
     let inner_attrs_str = if inner_attrs.is_empty() {
         String::new()
     } else {
-        inner_attrs
+        shape.indent.block_indent(context.config);
+        let result = inner_attrs
             .rewrite(context, shape)
-            .map(|s| format!("{}{}\n", nested_indent_str, s))?
+            .map(|s| format!("{}{}\n", nested_indent_str, s))?;
+        shape.indent.block_unindent(context.config);
+        result
     };
 
     let open_brace_pos = if inner_attrs.is_empty() {