strsim

Function generic_levenshtein

source
pub fn generic_levenshtein<'a, 'b, Iter1, Iter2, Elem1, Elem2>(
    a: &'a Iter1,
    b: &'b Iter2,
) -> usize
where &'a Iter1: IntoIterator<Item = Elem1>, &'b Iter2: IntoIterator<Item = Elem2>, Elem1: PartialEq<Elem2>,
Expand description

Calculates the minimum number of insertions, deletions, and substitutions required to change one sequence into the other.

use strsim::generic_levenshtein;

assert_eq!(3, generic_levenshtein(&[1,2,3], &[1,2,3,4,5,6]));