(&self, client: &Client, repo_id: RepoId, matches: &mut BTreeSet<SynonymEntry>)
| 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)] |
no test coverage detected