Skip to content

Commit

Permalink
Fix init complete scope
Browse files Browse the repository at this point in the history
  • Loading branch information
AZWN committed May 24, 2024
1 parent f464c85 commit f1b638b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
7 changes: 7 additions & 0 deletions scopegraphs/src/completeness/future.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ impl<LABEL: Hash + Eq + Label + Copy, DATA> Completeness<LABEL, DATA>
self.explicit_close.cmpl_new_scope(inner_scope_graph, scope)
}

fn cmpl_new_complete_scope(&self, _: &InnerScopeGraph<LABEL, DATA>, _: Scope) {
<FutureCompleteness<LABEL> as CriticalEdgeBasedCompleteness<LABEL, DATA>>::init_scope_with(
self,
HashSet::new(), // init with empty label set to prevent extension
)
}

type NewEdgeResult = <ExplicitClose<LABEL> as Completeness<LABEL, DATA>>::NewEdgeResult;

fn cmpl_new_edge(
Expand Down
5 changes: 2 additions & 3 deletions scopegraphs/src/completeness/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
//! queries return a [`Future`](std::future::Future) that resolves when all scopes related to the query are closed.
mod future;

pub use future::*;

mod critical_edge;
Expand Down Expand Up @@ -68,9 +69,7 @@ pub trait Completeness<LABEL, DATA>: Sealed {
&self,
inner_scope_graph: &InnerScopeGraph<LABEL, DATA>,
scope: Scope,
) {
self.cmpl_new_scope(inner_scope_graph, scope)
}
);

type NewEdgeResult;
fn cmpl_new_edge(
Expand Down
8 changes: 8 additions & 0 deletions scopegraphs/src/completeness/unchecked.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ impl UncheckedCompleteness {
impl<LABEL: Hash + Eq, DATA> Completeness<LABEL, DATA> for UncheckedCompleteness {
fn cmpl_new_scope(&self, _: &InnerScopeGraph<LABEL, DATA>, _: Scope) {}

fn cmpl_new_complete_scope(
&self,
inner_scope_graph: &InnerScopeGraph<LABEL, DATA>,
scope: Scope,
) {
self.cmpl_new_scope(inner_scope_graph, scope)
}

type NewEdgeResult = ();

fn cmpl_new_edge(
Expand Down

0 comments on commit f1b638b

Please sign in to comment.