MCPcopy Create free account
hub / github.com/emwalker/digraph / prefix_matches

Method prefix_matches

backend/src/git/index.rs:158–167  ·  view source on GitHub ↗
(&self, token: &Phrase)

Source from the content-addressed store, hash-verified

156 }
157
158 fn prefix_matches(&self, token: &Phrase) -> BTreeSet<SynonymEntry> {
159 let iter = self
160 .synonyms
161 .range::<Phrase, _>(token..)
162 .take_while(|(k, _)| k.starts_with(&token.0));
163
164 iter.fold(BTreeSet::new(), |acc, (_token, set)| {
165 acc.union(set).cloned().collect()
166 })
167 }
168}
169
170#[derive(Clone, Debug)]

Callers 2

Calls 2

starts_withMethod · 0.80
insertMethod · 0.80

Tested by

no test coverage detected