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
This commit is contained in:
llogiq 2024-11-25 20:25:27 +00:00 committed by GitHub
commit d49501c818
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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>,