Pre: Move PushComputed up module hierarchy; make it public.
This commit is contained in:
parent
70c5bcfa99
commit
002c918c96
2 changed files with 17 additions and 14 deletions
|
@ -841,6 +841,18 @@ impl ConjoiningClauses {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub trait PushComputed {
|
||||||
|
fn push_computed(&mut self, item: ComputedTable) -> DatomsTable;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl PushComputed for Vec<ComputedTable> {
|
||||||
|
fn push_computed(&mut self, item: ComputedTable) -> DatomsTable {
|
||||||
|
let next_index = self.len();
|
||||||
|
self.push(item);
|
||||||
|
DatomsTable::Computed(next_index)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// These are helpers that tests use to build Schema instances.
|
// These are helpers that tests use to build Schema instances.
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
fn associate_ident(schema: &mut Schema, i: NamespacedKeyword, e: Entid) {
|
fn associate_ident(schema: &mut Schema, i: NamespacedKeyword, e: Entid) {
|
||||||
|
|
|
@ -29,7 +29,10 @@ use mentat_query::{
|
||||||
WhereClause,
|
WhereClause,
|
||||||
};
|
};
|
||||||
|
|
||||||
use clauses::ConjoiningClauses;
|
use clauses::{
|
||||||
|
ConjoiningClauses,
|
||||||
|
PushComputed,
|
||||||
|
};
|
||||||
|
|
||||||
use errors::{
|
use errors::{
|
||||||
Result,
|
Result,
|
||||||
|
@ -74,18 +77,6 @@ fn _simply_matches_value_place(left: &PatternValuePlace, right: &PatternValuePla
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
trait PushComputed {
|
|
||||||
fn push_computed(&mut self, item: ComputedTable) -> DatomsTable;
|
|
||||||
}
|
|
||||||
|
|
||||||
impl PushComputed for Vec<ComputedTable> {
|
|
||||||
fn push_computed(&mut self, item: ComputedTable) -> DatomsTable {
|
|
||||||
let next_index = self.len();
|
|
||||||
self.push(item);
|
|
||||||
DatomsTable::Computed(next_index)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub enum DeconstructedOrJoin {
|
pub enum DeconstructedOrJoin {
|
||||||
KnownSuccess,
|
KnownSuccess,
|
||||||
KnownEmpty(EmptyBecause),
|
KnownEmpty(EmptyBecause),
|
||||||
|
@ -1119,4 +1110,4 @@ mod testing {
|
||||||
[_ :foo/height ?x]]"#;
|
[_ :foo/height ?x]]"#;
|
||||||
compare_ccs(alg(&schema, query), alg(&schema, simple));
|
compare_ccs(alg(&schema, query), alg(&schema, simple));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue