Skip to content

Commit c0b8564

Browse files
raphaelstyclaude
andcommitted
Fix clippy manual_range_contains warnings
Use (0..k).contains(&label) instead of manual range checks 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 4e3278c commit c0b8564

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/algorithm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ mod tests {
325325

326326
// All labels should be valid
327327
for &label in result.labels.iter() {
328-
assert!(label >= 0 && label < 5);
328+
assert!((0..5).contains(&label));
329329
}
330330
}
331331

src/kmeans.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ mod tests {
256256
assert_eq!(labels.len(), 100);
257257

258258
for &label in labels.iter() {
259-
assert!(label >= 0 && label < 8);
259+
assert!((0..8).contains(&label));
260260
}
261261
}
262262

tests/integration_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ fn test_basic_predict() {
155155

156156
// All labels should be in valid range
157157
for &label in labels.iter() {
158-
assert!(label >= 0 && label < 8, "Labels should be in range [0, k)");
158+
assert!((0..8).contains(&label), "Labels should be in range [0, k)");
159159
}
160160
}
161161

0 commit comments

Comments
 (0)