From e1f6b666c92463e849e0a1dc82bb3594af71e100 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Wed, 16 Dec 2020 12:43:51 +0100 Subject: [PATCH] Slightly simplify search output loop variable --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 7810ff3..a1438e5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -185,7 +185,7 @@ where } let found = min(search.nearest.len(), out.len()); - for (i, candidate) in search.nearest.iter().take(found).enumerate() { + for (i, candidate) in search.nearest[..found].iter().enumerate() { out[i] = candidate.pid; } found