From c585715224c180ff84630c05aa763d0d271f350a Mon Sep 17 00:00:00 2001 From: Victor Porof Date: Wed, 8 Feb 2017 12:19:16 +0100 Subject: [PATCH] Don't depend on num and ordered-float in the db and query crates, r=ncalexan (#223) Signed-off-by: Victor Porof --- db/Cargo.toml | 3 --- db/src/lib.rs | 2 -- db/src/types.rs | 3 +-- edn/src/lib.rs | 6 ++++-- query-parser/Cargo.toml | 1 - query-parser/src/parse.rs | 3 +-- query/Cargo.toml | 2 -- query/src/lib.rs | 6 +----- 8 files changed, 7 insertions(+), 19 deletions(-) diff --git a/db/Cargo.toml b/db/Cargo.toml index d4aba934..71bc39bb 100644 --- a/db/Cargo.toml +++ b/db/Cargo.toml @@ -5,9 +5,6 @@ version = "0.0.1" [dependencies] error-chain = "0.8.0" lazy_static = "0.2.2" -# TODO: don't depend on num and ordered-float; expose helpers in edn abstracting necessary constructors. -num = "0.1.35" -ordered-float = "0.4.0" [dependencies.rusqlite] version = "0.9.3" diff --git a/db/src/lib.rs b/db/src/lib.rs index 29fa7bf6..ecd77468 100644 --- a/db/src/lib.rs +++ b/db/src/lib.rs @@ -12,8 +12,6 @@ extern crate error_chain; #[macro_use] extern crate lazy_static; -extern crate num; -extern crate ordered_float; extern crate rusqlite; extern crate edn; diff --git a/db/src/types.rs b/db/src/types.rs index 8fda08d3..d24141fc 100644 --- a/db/src/types.rs +++ b/db/src/types.rs @@ -11,8 +11,7 @@ #![allow(dead_code)] use std::collections::{BTreeMap}; - -use ordered_float::{OrderedFloat}; +use edn::OrderedFloat; extern crate mentat_core; diff --git a/edn/src/lib.rs b/edn/src/lib.rs index 002ea4c2..61855f26 100644 --- a/edn/src/lib.rs +++ b/edn/src/lib.rs @@ -21,5 +21,7 @@ pub mod parse { include!(concat!(env!("OUT_DIR"), "/edn.rs")); } -pub use self::types::Value; -pub use self::symbols::{Keyword, NamespacedKeyword, PlainSymbol, NamespacedSymbol}; +pub use ordered_float::OrderedFloat; +pub use num::BigInt; +pub use types::Value; +pub use symbols::{Keyword, NamespacedKeyword, PlainSymbol, NamespacedSymbol}; diff --git a/query-parser/Cargo.toml b/query-parser/Cargo.toml index 3abf2ce7..78800512 100644 --- a/query-parser/Cargo.toml +++ b/query-parser/Cargo.toml @@ -5,7 +5,6 @@ version = "0.0.1" [dependencies] combine = "2.1.1" matches = "0.1" -ordered-float = "0.4.0" [dependencies.edn] path = "../edn" diff --git a/query-parser/src/parse.rs b/query-parser/src/parse.rs index dfe25f59..78b789e2 100644 --- a/query-parser/src/parse.rs +++ b/query-parser/src/parse.rs @@ -244,10 +244,9 @@ mod test { extern crate combine; extern crate edn; extern crate mentat_query; - extern crate ordered_float; use self::combine::Parser; - use self::ordered_float::OrderedFloat; + use self::edn::OrderedFloat; use self::mentat_query::{ Element, FindSpec, diff --git a/query/Cargo.toml b/query/Cargo.toml index 943e4709..e2b7baa7 100644 --- a/query/Cargo.toml +++ b/query/Cargo.toml @@ -3,8 +3,6 @@ name = "mentat_query" version = "0.0.1" [dependencies] -num = "0.1.35" -ordered-float = "0.4.0" [dependencies.edn] path = "../edn" diff --git a/query/src/lib.rs b/query/src/lib.rs index 5e3bc968..eb0c9000 100644 --- a/query/src/lib.rs +++ b/query/src/lib.rs @@ -31,12 +31,8 @@ ///! a tradeoff against well-typed function signatures and other such boundaries. extern crate edn; -extern crate num; -extern crate ordered_float; -use num::BigInt; -use ordered_float::OrderedFloat; -use edn::{NamespacedKeyword, PlainSymbol}; +use edn::{BigInt, OrderedFloat, NamespacedKeyword, PlainSymbol}; pub type SrcVarName = String; // Do not include the required syntactic '$'.