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

Method into_matches

backend/src/git/ext.rs:636–651  ·  view source on GitHub ↗
(
        self,
        search: &Search,
        locale: Locale,
        take: usize,
    )

Source from the content-addressed store, hash-verified

634
635impl Objects {
636 pub fn into_matches(
637 self,
638 search: &Search,
639 locale: Locale,
640 take: usize,
641 ) -> Result<BTreeSet<SearchMatch>> {
642 let mut matches = BTreeSet::new();
643
644 for (_key, object) in self.0.into_iter() {
645 matches.insert(object.to_search_match(locale, search)?);
646 }
647
648 // We won't know what is at the top of the results (e.g., a matching topic) until we've
649 // built the full btree set. So we wait to apply the limit until after this has been done.
650 Ok(matches.into_iter().take(take).collect())
651 }
652
653 pub fn into_hash(self) -> HashMap<Okey, Object> {
654 self.0

Callers 2

fetch_matchesMethod · 0.80
fetch_downsetMethod · 0.80

Calls 2

insertMethod · 0.80
to_search_matchMethod · 0.80

Tested by

no test coverage detected