Add and use generics.is_empty() and generics.is_own_empty, rather than using generics' attributes
This commit is contained in:
@@ -391,6 +391,14 @@ impl<'tcx> Generics {
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
pub fn is_empty(&'tcx self) -> bool {
|
||||
self.count() == 0
|
||||
}
|
||||
|
||||
pub fn is_own_empty(&'tcx self) -> bool {
|
||||
self.own_params.is_empty()
|
||||
}
|
||||
}
|
||||
|
||||
/// Bounds on generics.
|
||||
|
||||
Reference in New Issue
Block a user