fix clippy::filter_next: use .find(..) instead of .filter(..).next()

This commit is contained in:
Matthias Krüger 2020-08-01 17:40:26 +02:00
parent 3ef8c72577
commit 8bc1f91822

View File

@ -85,11 +85,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
debug!("try_report_named_anon_conflict: ret ty {:?}", ty);
if sub == &ty::ReStatic
&& v.0
.into_iter()
.filter(|t| t.span.desugaring_kind().is_none())
.next()
.is_some()
&& v.0.into_iter().find(|t| t.span.desugaring_kind().is_none()).is_some()
{
// If the failure is due to a `'static` requirement coming from a `dyn` or
// `impl` Trait that *isn't* caused by `async fn` desugaring, handle this case