Update src/matches.rs

Co-authored-by: Yacin Tmimi <yacintmimi@gmail.com>
This commit is contained in:
Febriananda Wida Pramudita 2024-04-25 10:28:35 +07:00 committed by Yacin Tmimi
parent 23c11f3a08
commit 1f806d979a

View File

@ -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() {