about summary refs log tree commit diff
diff options
context:
space:
mode:
authorllogiq <bogusandre@gmail.com>2024-11-25 20:25:27 +0000
committerGitHub <noreply@github.com>2024-11-25 20:25:27 +0000
commitd49501c8185746bc5ba27fa0f12f11a719c2498a (patch)
tree2ced591e5138b7703bde8c3df4c9a7335c4ee55c
parent3d881e1e595dae6d5616bfd41da756967f0ae6c3 (diff)
parent80df2c4cede1ac58eac55c3d50b72f34dae6c65f (diff)
downloadrust-d49501c8185746bc5ba27fa0f12f11a719c2498a.tar.gz
rust-d49501c8185746bc5ba27fa0f12f11a719c2498a.zip
Use a better description of an internal function (#13721)
Found while reading code: the comment was incorrect as it stops counting
as soon as two elements are different.

changelog: none
-rw-r--r--clippy_utils/src/hir_utils.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/clippy_utils/src/hir_utils.rs b/clippy_utils/src/hir_utils.rs
index 7bc70836651..5c93a9948b8 100644
--- a/clippy_utils/src/hir_utils.rs
+++ b/clippy_utils/src/hir_utils.rs
@@ -733,7 +733,7 @@ pub fn over<X>(left: &[X], right: &[X], mut eq_fn: impl FnMut(&X, &X) -> bool) -
     left.len() == right.len() && left.iter().zip(right).all(|(x, y)| eq_fn(x, y))
 }
 
-/// Counts how many elements of the slices are equal as per `eq_fn`.
+/// Counts how many elements at the beginning of the slices are equal as per `eq_fn`.
 pub fn count_eq<X: Sized>(
     left: &mut dyn Iterator<Item = X>,
     right: &mut dyn Iterator<Item = X>,