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

Method link_details

backend/src/git/ext.rs:26–52  ·  view source on GitHub ↗
(&self, context: RepoId)

Source from the content-addressed store, hash-verified

24 }
25
26 pub fn link_details(&self, context: RepoId) -> Result<(Vec<RepoLinkWrapper>, RepoLinkWrapper)> {
27 let mut display_link: Option<RepoLinkWrapper> = match self.0.get(&context) {
28 Some(repo_topic) => {
29 if repo_topic.has_details() {
30 Some((context, repo_topic).try_into()?)
31 } else {
32 None
33 }
34 }
35 None => None,
36 };
37
38 let mut topics = vec![];
39
40 for (&repo_id, object) in self.iter() {
41 if display_link.is_none() && object.has_details() {
42 display_link = Some((repo_id, object).try_into()?);
43 }
44 topics.push((repo_id, object).try_into()?);
45 }
46
47 if display_link.is_none() {
48 return Err(Error::Repo("no display link".into()));
49 }
50
51 Ok((topics, display_link.unwrap()))
52 }
53
54 pub fn topic_details(
55 &self,

Callers 1

finalizeMethod · 0.80

Calls 5

RepoClass · 0.85
has_detailsMethod · 0.80
getMethod · 0.45
try_intoMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected