diff --git a/scopegraphs/src/containers/env.rs b/scopegraphs/src/containers/env.rs index 96c6ed3..928f59e 100644 --- a/scopegraphs/src/containers/env.rs +++ b/scopegraphs/src/containers/env.rs @@ -216,8 +216,7 @@ where let sub_env = sub_env.clone(); sub_env.into_iter().try_fold( Env::new(), - |mut filtered_env: Env<'sg, LABEL, DATA>, - p1: ResolvedPath<'sg, LABEL, DATA>| { + |mut filtered_env: Env<'sg, LABEL, DATA>, p1: ResolvedPath<'sg, LABEL, DATA>| { let shadowed = base_env.iter().try_fold( /* initially, not shadowed */ false, |previously_shadowed: bool, p2: &ResolvedPath<'sg, LABEL, DATA>| { diff --git a/scopegraphs/src/containers/path.rs b/scopegraphs/src/containers/path.rs index 9ec306b..9201dcd 100644 --- a/scopegraphs/src/containers/path.rs +++ b/scopegraphs/src/containers/path.rs @@ -4,7 +4,7 @@ use futures::future::join_all; use std::fmt::Debug; use std::hash::Hash; -use super::{Injectable, Filterable}; +use super::{Filterable, Injectable}; /// Interface for path containers that support the operations required for query resolution. pub trait PathContainer<'sg, 'rslv, LABEL: 'sg, DATA: 'sg>: Debug + 'rslv { diff --git a/scopegraphs/src/resolve/lookup.rs b/scopegraphs/src/resolve/lookup.rs index 62cb350..6bbac3e 100644 --- a/scopegraphs/src/resolve/lookup.rs +++ b/scopegraphs/src/resolve/lookup.rs @@ -16,8 +16,8 @@ use std::sync::Arc; use crate::completeness::Completeness; use crate::containers::{ - EnvContainer, Injectable, PathContainer, PathContainerWf, ScopeContainer, ScopeContainerWf, - Filterable, + EnvContainer, Filterable, Injectable, PathContainer, PathContainerWf, ScopeContainer, + ScopeContainerWf, }; use crate::resolve::{ DataEquivalence, DataWellformedness, EdgeOrData, LabelOrder, Path, Query, Resolve, ResolvedPath, @@ -227,11 +227,12 @@ where let mut base_env = base_env.clone(); let sub_env = local_self.resolve_edge(path_wellformedness.clone(), edge, path); sub_env.flat_map(move |sub_env| { - let merged_env: EnvC<'sg, 'rslv, CMPL, LABEL, DATA, DWF::Output, DEq::Output> = Filterable::filter(&base_env, sub_env, local_self.data_equiv); - merged_env.flat_map(move |merged_env| { - base_env.merge(merged_env); - base_env.into() - }) + let filtered_env: EnvC<'sg, 'rslv, CMPL, LABEL, DATA, DWF::Output, DEq::Output> = + Filterable::filter(&base_env, sub_env, local_self.data_equiv); + filtered_env.flat_map(move |filtered_env| { + base_env.merge(filtered_env); + base_env.into() + }) }) } })) diff --git a/scopegraphs/src/resolve/mod.rs b/scopegraphs/src/resolve/mod.rs index 002a1ba..af41529 100644 --- a/scopegraphs/src/resolve/mod.rs +++ b/scopegraphs/src/resolve/mod.rs @@ -372,8 +372,7 @@ where } } -impl<'sg, LABEL: 'sg, DATA> FromIterator> - for Env<'sg, LABEL, DATA> +impl<'sg, LABEL: 'sg, DATA> FromIterator> for Env<'sg, LABEL, DATA> where ResolvedPath<'sg, LABEL, DATA>: Eq + Hash, {