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

Method fetch_prefix

backend/src/git/search.rs:175–188  ·  view source on GitHub ↗
(&self, client: &Client, repo_id: RepoId, matches: &mut BTreeSet<SynonymEntry>)

Source from the content-addressed store, hash-verified

173 }
174
175 fn fetch_prefix(&self, client: &Client, repo_id: RepoId, matches: &mut BTreeSet<SynonymEntry>) {
176 let tokens = &mut self.search.tokens.iter();
177 let start = match tokens.next() {
178 Some(token) => client.synonym_token_prefix_matches(repo_id, token),
179 None => BTreeSet::new(),
180 };
181
182 let mut result = tokens.fold(start, |acc, token| {
183 let result = client.synonym_token_prefix_matches(repo_id, token);
184 acc.intersection(&result).cloned().collect()
185 });
186
187 matches.append(&mut result);
188 }
189}
190
191#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd)]

Callers 1

fetchMethod · 0.80

Calls 4

nextMethod · 0.80
iterMethod · 0.45
intersectionMethod · 0.45

Tested by

no test coverage detected