1
Fork 0

use matches!() macro for simple if let conditions

This commit is contained in:
Matthias Krüger 2020-09-18 19:11:06 +02:00
parent 2c69266c06
commit 40dddd3305
15 changed files with 33 additions and 36 deletions

View file

@ -868,10 +868,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
.emit();
}
if !bounds
.iter()
.any(|b| if let GenericBound::Trait(..) = *b { true } else { false })
{
if !bounds.iter().any(|b| matches!(b, GenericBound::Trait(..))) {
self.err_handler().span_err(ty.span, "at least one trait must be specified");
}