Skip to content

Commit

Permalink
Fix existing iter-nth-zero violations
Browse files Browse the repository at this point in the history
  • Loading branch information
bradsherman committed Dec 31, 2019
1 parent 99dd0bb commit f8e6673
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clippy_lints/src/inherent_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down

0 comments on commit f8e6673

Please sign in to comment.