MCPcopy Create free account
hub / github.com/PerroEngine/Perro / docs_by_area

Function docs_by_area

perro_website/src/docs.rs:80–91  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

78 docs()
79 .iter()
80 .find(|doc| doc.collection == collection && doc.slug == normalized)
81 .or_else(|| {
82 let index_slug = format!("{normalized}/index");
83 docs()
84 .iter()
85 .find(|doc| doc.collection == collection && doc.slug == index_slug)
86 })
87}
88
89pub fn docs_by_area() -> Vec<(&'static str, usize)> {
90 let mut out = Vec::<(&'static str, usize)>::new();
91 for doc in docs().iter().filter(|doc| doc.collection == "docs") {
92 if let Some((area, count)) = out.last_mut().filter(|(area, _)| *area == doc.area) {
93 let _ = area;
94 *count += 1;

Callers 2

DocsIndexPageFunction · 0.85
DocArticleFunction · 0.85

Calls 4

docsFunction · 0.85
iterMethod · 0.45
pushMethod · 0.45
as_strMethod · 0.45

Tested by

no test coverage detected