refactor if into match

This commit is contained in:
Febriananda Wida Pramudita 2024-04-26 14:25:51 +07:00 committed by Yacin Tmimi
parent 1f806d979a
commit 76ab3c19d8

View File

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