suggest_similar

Function suggest_similar 

Source
pub fn suggest_similar<'a>(
    query: &str,
    candidates: &[&'a str],
) -> Option<&'a str>
Expand description

Find the most similar string from a list of candidates.

Returns the closest match if within the edit distance threshold:

  • For names <= 5 characters: threshold is 2
  • For longer names: threshold is 3