Skip to main content

capture_diff_slices_by_key

Function capture_diff_slices_by_key 

Source
pub fn capture_diff_slices_by_key<T, K: Hash + Eq>(
    alg: Algorithm,
    old: &[T],
    new: &[T],
    key: impl Fn(&T) -> K,
) -> Vec<DiffOp>
Expand description

Creates a diff between old and new slices using a key extractor.

Elements are compared by the key returned from the key closure. This is a convenience wrapper around capture_diff_slices_by.