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

Method topic_searches

backend/src/git/client.rs:414–441  ·  view source on GitHub ↗
(
        &self,
        repo_id: RepoId,
        topic: Option<RepoTopic>,
    )

Source from the content-addressed store, hash-verified

412 }
413
414 fn topic_searches(
415 &self,
416 repo_id: RepoId,
417 topic: Option<RepoTopic>,
418 ) -> Result<BTreeSet<Search>> {
419 if !self.viewer.can_read(repo_id) {
420 return Err(Error::NotFound(format!("not found: {topic:?}")));
421 }
422
423 let searches = match topic {
424 Some(topic) => {
425 let mut searches = BTreeSet::new();
426
427 for synonym in topic.synonyms() {
428 let search = Search::parse(&synonym.name)?;
429 if search.is_empty() {
430 continue;
431 }
432 searches.insert(search);
433 }
434
435 searches
436 }
437 None => BTreeSet::new(),
438 };
439
440 Ok(searches)
441 }
442
443 pub fn mutation(&self, mode: IndexMode) -> Result<Mutation> {
444 Ok(Mutation {

Callers 1

save_topicMethod · 0.80

Calls 5

parseFunction · 0.85
can_readMethod · 0.80
insertMethod · 0.80
synonymsMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected