Part 1: Move intern_set into edn crate.

It's not great to keep lifting functionality higher and higher up the
crate hierarchy, but we really do want to intern while we parse.
Eventually, I expect that we will split the `edn` crate into `types`
and `parsing`, and the `types` crate can depend on a more efficient
interning dependency.
This commit is contained in:
Nick Alexander 2018-07-02 09:22:27 -07:00
parent d82c7f8ef2
commit 87f850a44e
7 changed files with 25 additions and 19 deletions

View file

@ -365,7 +365,6 @@ impl HasSchema for Schema {
}
}
pub mod intern_set;
pub mod counter;
pub mod util;

View file

@ -1119,20 +1119,21 @@ mod tests {
use debug;
use errors;
use edn;
use edn::{
InternSet,
};
use edn::entities::{
OpType,
TempId,
};
use mentat_core::{
HasSchema,
Keyword,
KnownEntid,
attribute,
};
use mentat_core::intern_set::{
InternSet,
};
use mentat_core::util::Either::*;
use edn::entities::{
OpType,
TempId,
};
use rusqlite;
use std::collections::{
BTreeMap,

View file

@ -66,6 +66,7 @@ use db::{
PartitionMapping,
};
use edn::{
InternSet,
Keyword,
};
use entids;
@ -101,8 +102,6 @@ use mentat_core::{
now,
};
use mentat_core::intern_set::InternSet;
use edn::entities as entmod;
use edn::entities::{
AttributePlace,

View file

@ -41,7 +41,7 @@ impl<T> InternSet<T> where T: Eq + Hash {
///
/// ```
/// use std::rc::Rc;
/// use mentat_core::intern_set::InternSet;
/// use edn::intern_set::InternSet;
///
/// let mut s = InternSet::new();
///

View file

@ -23,6 +23,10 @@ extern crate serde;
extern crate serde_derive;
pub mod entities;
pub mod intern_set;
pub use intern_set::{
InternSet,
};
// Intentionally not pub.
mod namespaceable_name;
pub mod query;

View file

@ -41,6 +41,9 @@ use rusqlite::{
};
use edn;
use edn::{
InternSet,
};
use mentat_core::{
Attribute,
@ -55,8 +58,6 @@ use mentat_core::{
ValueType,
};
use mentat_core::intern_set::InternSet;
use mentat_db::cache::{
InProgressCacheTransactWatcher,
InProgressSQLiteAttributeCache,

View file

@ -53,6 +53,14 @@
// We probably need both, but this file provides the latter. Unfortunately, Entity -- the input to
// the transactor -- is intimately tied to EDN and to spanned values.
use edn::{
InternSet,
};
use edn::entities::{
OpType,
TempId,
};
use mentat_core::{
HasSchema,
KnownEntid,
@ -60,7 +68,6 @@ use mentat_core::{
TypedValue,
};
use mentat_core::intern_set::InternSet;
use mentat_core::util::Either;
use mentat_db::{
@ -75,11 +82,6 @@ use mentat_db::internal_types::{
TypedValueOr,
};
use edn::entities::{
OpType,
TempId,
};
use conn::{
InProgress,
};