From f1b638bfd48e3f1a8215bbdf6067aaf248b6acd0 Mon Sep 17 00:00:00 2001 From: Aron Zwaan Date: Fri, 24 May 2024 14:49:16 +0200 Subject: [PATCH] Fix init complete scope --- scopegraphs/src/completeness/future.rs | 7 +++++++ scopegraphs/src/completeness/mod.rs | 5 ++--- scopegraphs/src/completeness/unchecked.rs | 8 ++++++++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/scopegraphs/src/completeness/future.rs b/scopegraphs/src/completeness/future.rs index 20ed841..4ca9274 100644 --- a/scopegraphs/src/completeness/future.rs +++ b/scopegraphs/src/completeness/future.rs @@ -43,6 +43,13 @@ impl Completeness self.explicit_close.cmpl_new_scope(inner_scope_graph, scope) } + fn cmpl_new_complete_scope(&self, _: &InnerScopeGraph, _: Scope) { + as CriticalEdgeBasedCompleteness>::init_scope_with( + self, + HashSet::new(), // init with empty label set to prevent extension + ) + } + type NewEdgeResult = as Completeness>::NewEdgeResult; fn cmpl_new_edge( diff --git a/scopegraphs/src/completeness/mod.rs b/scopegraphs/src/completeness/mod.rs index c96eea7..2de3dfd 100644 --- a/scopegraphs/src/completeness/mod.rs +++ b/scopegraphs/src/completeness/mod.rs @@ -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; @@ -68,9 +69,7 @@ pub trait Completeness: Sealed { &self, inner_scope_graph: &InnerScopeGraph, scope: Scope, - ) { - self.cmpl_new_scope(inner_scope_graph, scope) - } + ); type NewEdgeResult; fn cmpl_new_edge( diff --git a/scopegraphs/src/completeness/unchecked.rs b/scopegraphs/src/completeness/unchecked.rs index 06f4837..1284b7c 100644 --- a/scopegraphs/src/completeness/unchecked.rs +++ b/scopegraphs/src/completeness/unchecked.rs @@ -26,6 +26,14 @@ impl UncheckedCompleteness { impl Completeness for UncheckedCompleteness { fn cmpl_new_scope(&self, _: &InnerScopeGraph, _: Scope) {} + fn cmpl_new_complete_scope( + &self, + inner_scope_graph: &InnerScopeGraph, + scope: Scope, + ) { + self.cmpl_new_scope(inner_scope_graph, scope) + } + type NewEdgeResult = (); fn cmpl_new_edge(