Skip to main content

generate_permutation

Function generate_permutation 

Source
pub fn generate_permutation<T>(source: &[T], target: &[T]) -> PermutationResult
where T: Hash + Eq,
Expand description

Generate a permutation that when applied to the first argument’s elements produces the second argument. If there are elements in the first that are not in the second (and vice versa) then those elements will not be present in the final permutation, and thus the permutation will be shorter than both input slices. Information about which elements are unmatched in both the source and target vectors is provided in the result