pub fn nearest<'a, I, S>(input: &str, candidates: I) -> Option<&'a str>Expand description
Return the candidate nearest to input within DEFAULT_SUGGESTION_DISTANCE.
Convenience wrapper over nearest_within using the default threshold. See
it for the full matching semantics.
ยงExamples
use rskit_util::strings::nearest;
assert_eq!(nearest("fmt", ["format", "test", "lint"]), Some("format"));
assert_eq!(nearest("zzzzz", ["format", "test"]), None);