Skip to content

Commit 4136e7b

Browse files
committed
async lookups
1 parent f712a83 commit 4136e7b

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

scopegraphs-lib/src/completeness/future.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl<LABEL> Default for FutureCompleteness<LABEL> {
2626

2727
impl<LABEL> Sealed for FutureCompleteness<LABEL> {}
2828

29-
impl<'sg, LABEL: Hash + Eq + Label + Copy, DATA> Completeness<LABEL, DATA>
29+
impl<LABEL: Hash + Eq + Label + Copy, DATA> Completeness<LABEL, DATA>
3030
for FutureCompleteness<LABEL>
3131
{
3232
fn cmpl_new_scope(&self, inner_scope_graph: &mut InnerScopeGraph<LABEL, DATA>, scope: Scope) {

scopegraphs-lib/src/containers/scope.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub trait ScopeContainer<LABEL> {
1313
fn lift_step(self, lbl: LABEL, prefix: Path<LABEL>) -> Self::PathContainer;
1414
}
1515

16-
impl<'a, LABEL: Copy> ScopeContainer<LABEL> for Vec<Scope> {
16+
impl<LABEL: Copy> ScopeContainer<LABEL> for Vec<Scope> {
1717
type PathContainer = Vec<Path<LABEL>>;
1818

1919
fn lift_step(self, lbl: LABEL, prefix: Path<LABEL>) -> Self::PathContainer {
@@ -23,7 +23,7 @@ impl<'a, LABEL: Copy> ScopeContainer<LABEL> for Vec<Scope> {
2323
}
2424
}
2525

26-
impl<'a, LABEL, SC: ScopeContainer<LABEL>, E> ScopeContainer<LABEL> for Result<SC, E> {
26+
impl<LABEL, SC: ScopeContainer<LABEL>, E> ScopeContainer<LABEL> for Result<SC, E> {
2727
type PathContainer = Result<SC::PathContainer, E>;
2828

2929
fn lift_step(self, lbl: LABEL, prefix: Path<LABEL>) -> Self::PathContainer {

scopegraphs-lib/src/resolve/lookup.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ where
192192
env1.flat_map(move |agg_env| {
193193
let mut merged_env = agg_env.clone();
194194
env2.flat_map(move |new_env| {
195-
merged_env.merge(&new_env);
195+
merged_env.merge(new_env);
196196
<EnvC<'sg, 'rslv, CMPL, LABEL, DATA> as From<Env<'sg, LABEL, DATA>>>::from(
197197
merged_env,
198198
)
@@ -301,7 +301,7 @@ where
301301
}
302302

303303
/// Creates single-path environment if the data `path.target()` is matching, or an empty environment otherwise.
304-
fn resolve_data<'env>(&self, path: Path<LABEL>) -> EnvC<'sg, 'rslv, CMPL, LABEL, DATA> {
304+
fn resolve_data(&self, path: Path<LABEL>) -> EnvC<'sg, 'rslv, CMPL, LABEL, DATA> {
305305
let data = self.sg.get_data(path.target());
306306
if self.data_wellformedness.data_wf(data) {
307307
log::info!("{:?} matched: return singleton env.", data);
@@ -340,7 +340,7 @@ where
340340
smaller
341341
}
342342

343-
fn empty_env_container<'env>() -> EnvC<'sg, 'rslv, CMPL, LABEL, DATA> {
343+
fn empty_env_container() -> EnvC<'sg, 'rslv, CMPL, LABEL, DATA> {
344344
<EnvC<'sg, 'rslv, CMPL, LABEL, DATA> as EnvContainer<'sg, 'rslv, LABEL, DATA>>::empty()
345345
}
346346
}

scopegraphs-lib/src/resolve/mod.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::collections::HashSet;
33
use std::fmt::{Debug, Formatter};
44
use std::hash::Hash;
55
use std::marker::PhantomData;
6-
use std::sync::Arc;
6+
use std::rc::Rc;
77

88
use super::{Scope, ScopeGraph};
99

@@ -54,7 +54,7 @@ enum InnerPath<LABEL> {
5454
/// Path (alternating sequence of scopes and labels) in a scope graph.
5555
#[derive(Clone)]
5656
pub struct Path<LABEL> {
57-
inner_path: Arc<InnerPath<LABEL>>,
57+
inner_path: Rc<InnerPath<LABEL>>,
5858
/// Set of all scopes in this path.
5959
///
6060
/// Paths are alternating sequences of scopes and labels.
@@ -64,7 +64,7 @@ pub struct Path<LABEL> {
6464
/// This is cheaper than traversing the [`Path::inner_path`], at the cost of some more memory usage.
6565
///
6666
/// In order to make paths cheap to extend multiple times, we use a persistent data structure.
67-
scopes: Arc<TrieSet<Scope>>,
67+
scopes: Rc<TrieSet<Scope>>,
6868
// FIXME: put fields in same Arc
6969
}
7070

@@ -139,8 +139,8 @@ impl<LABEL> Path<LABEL> {
139139
/// Creates a new path that contains of a single scope.
140140
pub fn new(source: Scope) -> Self {
141141
Self {
142-
inner_path: Arc::new(InnerPath::Start { source }),
143-
scopes: Arc::new(TrieSet::new().insert(source)),
142+
inner_path: Rc::new(InnerPath::Start { source }),
143+
scopes: Rc::new(TrieSet::new().insert(source)),
144144
}
145145
}
146146

@@ -160,15 +160,15 @@ impl<LABEL> Path<LABEL> {
160160
None
161161
} else {
162162
Some(Self {
163-
inner_path: Arc::new(InnerPath::Step {
163+
inner_path: Rc::new(InnerPath::Step {
164164
prefix: Self {
165165
inner_path: self.inner_path.clone(),
166166
scopes: self.scopes.clone(),
167167
},
168168
label,
169169
target,
170170
}),
171-
scopes: Arc::new(self.scopes.insert(target)),
171+
scopes: Rc::new(self.scopes.insert(target)),
172172
})
173173
}
174174
}

scopegraphs-lib/src/scopegraph.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ where
140140
/// Get the targets of the outgoing edges of a scope with some label.
141141
///
142142
/// Permission for this operation is checked by `CMPL`.
143-
pub fn get_edges<'sg>(&'sg self, src: Scope, lbl: LABEL) -> CMPL::GetEdgesResult<'sg> {
143+
pub fn get_edges(&self, src: Scope, lbl: LABEL) -> CMPL::GetEdgesResult<'_> {
144144
self.completeness
145145
.cmpl_get_edges(&self.inner_scope_graph, src, lbl)
146146
}

0 commit comments

Comments
 (0)