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 counter;
pub mod util; pub mod util;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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