From 22a4306a7eadcf27e3957a66e6e596890d92c372 Mon Sep 17 00:00:00 2001 From: Febriananda Wida Pramudita Date: Sat, 13 Apr 2024 21:11:43 +0700 Subject: [PATCH] fix the logic --- src/matches.rs | 7 +++++-- 1 file 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() {