Skip to content

Commit

Permalink
Use a better description of an internal function (rust-lang#13721)
Browse files Browse the repository at this point in the history
Found while reading code: the comment was incorrect as it stops counting
as soon as two elements are different.

changelog: none
  • Loading branch information
llogiq authored Nov 25, 2024
2 parents 3d881e1 + 80df2c4 commit d49501c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clippy_utils/src/hir_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand Down

0 comments on commit d49501c

Please sign in to comment.