Reduce boilerplate with the matches! macro
Replaces simple bool `match`es of the form match $expr { $pattern => true _ => false } and their inverse with invocations of the matches! macro.
This commit is contained in:
parent
0f9f0b384a
commit
a6ff925f8b
13 changed files with 140 additions and 269 deletions
|
@ -588,10 +588,7 @@ impl<'tcx> TypeckResults<'tcx> {
|
|||
return false;
|
||||
}
|
||||
|
||||
match self.type_dependent_defs().get(expr.hir_id) {
|
||||
Some(Ok((DefKind::AssocFn, _))) => true,
|
||||
_ => false,
|
||||
}
|
||||
matches!(self.type_dependent_defs().get(expr.hir_id), Some(Ok((DefKind::AssocFn, _))))
|
||||
}
|
||||
|
||||
pub fn extract_binding_mode(&self, s: &Session, id: HirId, sp: Span) -> Option<BindingMode> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue