about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBrad Sherman <bsherman1096@gmail.com>2019-12-28 15:31:41 -0700
committerBrad Sherman <bsherman1096@gmail.com>2020-01-04 09:00:54 -0600
commit8ef53bf1967dfef9d20204552b0725673356ca14 (patch)
tree5059e1ff1523fe794a75310e1cee07855bdbcbaa
parent05b46034ea734f2b4436b700452771652ecc0074 (diff)
downloadrust-8ef53bf1967dfef9d20204552b0725673356ca14.tar.gz
rust-8ef53bf1967dfef9d20204552b0725673356ca14.zip
Fix existing iter-nth-zero violations
-rw-r--r--clippy_lints/src/inherent_impl.rs4
1 files 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,