Skip to main content

suggest_similar

Function suggest_similar 

Source
pub fn suggest_similar<S, I>(
    name: &str,
    candidates: I,
    max_distance: usize,
) -> Option<String>
where S: AsRef<str>, I: IntoIterator<Item = S>,
Expand description

Find the closest candidate within max_distance edits of name.

Returns a clone of the closest matching candidate. Ties are broken by insertion order (the first candidate wins).