Skip to content

Commit

Permalink
refactor if into match
Browse files Browse the repository at this point in the history
  • Loading branch information
Febriananda Wida Pramudita authored and ytmimi committed Apr 26, 2024
1 parent 1f806d9 commit 76ab3c1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/matches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 76ab3c1

Please sign in to comment.