From 8ef53bf1967dfef9d20204552b0725673356ca14 Mon Sep 17 00:00:00 2001 From: Brad Sherman Date: Sat, 28 Dec 2019 15:31:41 -0700 Subject: [PATCH] Fix existing iter-nth-zero violations --- clippy_lints/src/inherent_impl.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clippy_lints/src/inherent_impl.rs b/clippy_lints/src/inherent_impl.rs index 445891ff58a..ff35b81042b 100644 --- a/clippy_lints/src/inherent_impl.rs +++ b/clippy_lints/src/inherent_impl.rs @@ -61,7 +61,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MultipleInherentImpl { } fn check_crate_post(&mut self, cx: &LateContext<'a, 'tcx>, krate: &'tcx Crate<'_>) { - if let Some(item) = krate.items.values().nth(0) { + if let Some(item) = krate.items.values().next() { // Retrieve all inherent implementations from the crate, grouped by type for impls in cx .tcx @@ -71,7 +71,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MultipleInherentImpl { { // Filter out implementations that have generic params (type or lifetime) let mut impl_spans = impls.iter().filter_map(|impl_def| self.impls.get(impl_def)); - if let Some(initial_span) = impl_spans.nth(0) { + if let Some(initial_span) = impl_spans.next() { impl_spans.for_each(|additional_span| { span_lint_and_then( cx,