Skip to content

Commit 8ef53bf

Browse files
committed
Fix existing iter-nth-zero violations
1 parent 05b4603 commit 8ef53bf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clippy_lints/src/inherent_impl.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MultipleInherentImpl {
6161
}
6262

6363
fn check_crate_post(&mut self, cx: &LateContext<'a, 'tcx>, krate: &'tcx Crate<'_>) {
64-
if let Some(item) = krate.items.values().nth(0) {
64+
if let Some(item) = krate.items.values().next() {
6565
// Retrieve all inherent implementations from the crate, grouped by type
6666
for impls in cx
6767
.tcx
@@ -71,7 +71,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MultipleInherentImpl {
7171
{
7272
// Filter out implementations that have generic params (type or lifetime)
7373
let mut impl_spans = impls.iter().filter_map(|impl_def| self.impls.get(impl_def));
74-
if let Some(initial_span) = impl_spans.nth(0) {
74+
if let Some(initial_span) = impl_spans.next() {
7575
impl_spans.for_each(|additional_span| {
7676
span_lint_and_then(
7777
cx,

0 commit comments

Comments
 (0)