Skip to content

Commit

Permalink
Rewrite search_same description
Browse files Browse the repository at this point in the history
  • Loading branch information
jsoref committed Apr 17, 2023
1 parent eef46ac commit ab9659f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions clippy_utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2233,8 +2233,12 @@ pub fn is_slice_of_primitives(cx: &LateContext<'_>, expr: &Expr<'_>) -> Option<S
None
}

/// returns list of all pairs (a, b) from `exprs` such that `eq(a, b)`
/// `hash` must be comformed with `eq`
/// Given functions `eq` and `hash` such that `eq(a, b) == true`
/// implies `hash(a) == hash(b)`
///
/// returns list of all pairs `(a, b)` where `eq(a, b) == true`
/// and `a` is before `b` in `exprs` for all `a` and `b` in
/// `exprs`
pub fn search_same<T, Hash, Eq>(exprs: &[T], hash: Hash, eq: Eq) -> Vec<(&T, &T)>
where
Hash: Fn(&T) -> u64,
Expand Down

0 comments on commit ab9659f

Please sign in to comment.