pub fn match_rank(name: &str, query_lower: &str) -> u8Expand description
What: Rank how well a package name matches a query (lower is better).
Inputs:
name: Package name to match against.query_lower: Query string (must be lowercase).
Output:
- Returns a
u8rank: 0 = exact match, 1 = prefix match, 2 = substring match, 3 = no match.
Details:
- Expects
query_lowerto be lowercase; the name is lowercased internally. - Returns 3 (no match) if the query is empty.