Skip to content

Commit

Permalink
Simplify per review comment - use defer and matches!
Browse files Browse the repository at this point in the history
  • Loading branch information
davidBar-On committed Jun 21, 2022
1 parent f894355 commit a8185cf
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -944,16 +944,10 @@ fn join_bounds_inner(
// Whether a PathSegment segment includes internal array containing more than one item
let is_segment_with_multi_items_array = |seg: &ast::PathSegment| {
if let Some(args_in) = &seg.args {
match &**args_in {
ast::AngleBracketed(args) => {
if args.args.len() > 1 {
true
} else {
false
}
}
_ => false,
}
matches!(
args_in.deref(),
ast::GenericArgs::AngleBracketed(bracket_args) if bracket_args.args.len() > 1
)
} else {
false
}
Expand Down

0 comments on commit a8185cf

Please sign in to comment.