[][src]Function cargo::util::lev_distance::closest

pub fn closest<'a, T>(
    choice: &str,
    iter: impl Iterator<Item = T>,
    key: impl Fn(&T) -> &'a str
) -> Option<T>

Find the closest element from iter matching choice. The key callback is used to select a &str from the iterator to compare against choice.