fuzzy_match_rank_with_matcher

Function fuzzy_match_rank_with_matcher 

Source
pub fn fuzzy_match_rank_with_matcher(
    name: &str,
    query: &str,
    matcher: &SkimMatcherV2,
) -> Option<i64>
Expand description

Rank how well a package name matches a query using fuzzy matching (fzf-style) with a provided matcher.

Inputs:

  • name: Package name to match against
  • query: Query string to match
  • matcher: Reference to a SkimMatcherV2 instance to reuse across multiple calls

Output:

  • Some(score) if the query matches the name (higher score = better match), None if no match

Details:

  • Uses the provided fuzzy_matcher::skim::SkimMatcherV2 for fzf-style fuzzy matching
  • Returns scores where higher values indicate better matches
  • Returns None when the query doesn’t match at all
  • This function is optimized for cases where the matcher can be reused across multiple calls