MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / directory_facets

Function directory_facets

atomic-repository/src/content_search.rs:347–352  ·  view source on GitHub ↗
(counts: impl IntoIterator<Item = (String, usize)>)

Source from the content-addressed store, hash-verified

345}
346
347fn directory_facets(counts: impl IntoIterator<Item = (String, usize)>) -> Vec<(String, usize)> {
348 let mut facets: Vec<_> = counts.into_iter().collect();
349 facets.sort_by(|a, b| b.1.cmp(&a.1).then_with(|| a.0.cmp(&b.0)));
350 facets.truncate(10);
351 facets
352}
353
354/// Search graph-rendered bytes without consulting the working-copy index.
355/// Path/type matching and line verification use the same syntext machinery as

Callers 2

runMethod · 0.85
rank_content_matchesFunction · 0.85

Calls 4

truncateMethod · 0.80
collectMethod · 0.45
into_iterMethod · 0.45
cmpMethod · 0.45

Tested by

no test coverage detected