How to handle path visibility?
(
&self,
repo_id: RepoId,
descendant_id: &ExternalId,
ancestor_id: &ExternalId,
)
| 135 | |
| 136 | // How to handle path visibility? |
| 137 | fn cycle_exists( |
| 138 | &self, |
| 139 | repo_id: RepoId, |
| 140 | descendant_id: &ExternalId, |
| 141 | ancestor_id: &ExternalId, |
| 142 | ) -> Result<bool> { |
| 143 | let mut i = 0; |
| 144 | |
| 145 | if let Some(descendant_path) = self.topic_path(repo_id, descendant_id)? { |
| 146 | for topic in self.topic_downset(&descendant_path) { |
| 147 | i += 1; |
| 148 | if topic.topic_id() == ancestor_id { |
| 149 | log::info!("cycle found after {} iterations", i); |
| 150 | return Ok(true); |
| 151 | } |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | log::info!("no cycle found after {} iterations", i); |
| 156 | Ok(false) |
| 157 | } |
| 158 | |
| 159 | pub fn downset(&self, topic_path: &TopicPath) -> DownsetIter<'_> { |
| 160 | DownsetIter::new( |
no test coverage detected