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

Method validate

backend/src/git/topic.rs:356–373  ·  view source on GitHub ↗
(&self, mutation: &Mutation)

Source from the content-addressed store, hash-verified

354 }
355
356 fn validate(&self, mutation: &Mutation) -> Result<()> {
357 if self.parent_topic_ids.is_empty() {
358 return Err(Error::Repo(
359 "at least one parent topic must be provided".into(),
360 ));
361 }
362
363 for parent in self.parent_topic_ids.iter() {
364 if mutation.cycle_exists(self.repo_id, self.topic_id, parent)? {
365 return Err(Error::Repo(format!(
366 "{} is a parent topic of {}",
367 self.topic_id, parent
368 )));
369 }
370 }
371
372 Ok(())
373 }
374}
375
376pub struct UpdateTopicSynonyms {

Callers 1

callMethod · 0.45

Calls 4

RepoClass · 0.85
cycle_existsMethod · 0.80
is_emptyMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected