Skip to content

Commit

Permalink
Clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
cr-fuel committed Oct 24, 2023
1 parent 4a68940 commit 1e0ddee
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions swayfmt/src/utils/language/expr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -694,16 +694,13 @@ where
{
let has_single_argument_and_can_be_inlined =
if args.value_separator_pairs.len() == 1 && args.final_value_opt.is_none() {
match args.value_separator_pairs[0].0 {
Expr::Struct { path: _, fields: _ } => true,
_ => false,
}
} else if args.value_separator_pairs.len() == 0 {
matches!(
args.value_separator_pairs[0].0,
Expr::Struct { path: _, fields: _ }
)
} else if args.value_separator_pairs.is_empty() {
if let Some(final_value) = &args.final_value_opt {
match **final_value {
Expr::Struct { path: _, fields: _ } => true,
_ => false,
}
matches!(**final_value, Expr::Struct { path: _, fields: _ })
} else {
true
}
Expand Down

0 comments on commit 1e0ddee

Please sign in to comment.