MCPcopy Index your code
hub / github.com/emwalker/digraph / next

Method next

backend/src/git/types.rs:550–583  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

548 type Item = RepoTopic;
549
550 fn next(&mut self) -> Option<Self::Item> {
551 log::debug!("next() with {} stack elements", self.stack.len());
552
553 while !self.stack.is_empty() {
554 match self.stack.pop() {
555 Some(topic_child) => {
556 if self.seen.contains(&topic_child) {
557 log::debug!("topic already seen, skipping: {}", topic_child.id);
558 continue;
559 }
560 self.seen.insert(topic_child.clone());
561
562 let topic_id = &topic_child.id;
563
564 if let Some(topic) = self.client.fetch_topic(self.repo_id, topic_id) {
565 for child in &topic.children {
566 if child.kind != Kind::Topic {
567 break;
568 }
569 self.stack.push(child.clone());
570 }
571 log::debug!("yielding topic {}", topic_child.id);
572 return Some(topic);
573 };
574 }
575
576 None => {
577 log::error!("expected a topic, continuing");
578 }
579 }
580 }
581
582 None
583 }
584}
585
586impl<'c> TopicDownsetIter<'c> {

Callers 9

titleMethod · 0.80
fetch_prefixMethod · 0.80
fetch_matchesMethod · 0.80
url_pathsMethod · 0.80
no_orphansFunction · 0.80
no_cyclesFunction · 0.80
matching_topicsFunction · 0.80

Calls 5

containsMethod · 0.80
insertMethod · 0.80
is_emptyMethod · 0.45
fetch_topicMethod · 0.45
topic_idMethod · 0.45

Tested by 5

no_orphansFunction · 0.64
no_cyclesFunction · 0.64
matching_topicsFunction · 0.64