From 2b90f7d03a607ca1507951c6b9a931bd1f7e8384 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Sat, 9 Jan 2016 12:12:36 +0100 Subject: [PATCH] Introduce use-dependency amalgamation. We now have: - `use standard;` (bring in a set of standard and external dependencies) - `use common;` (bring in a low-level subset of this crate; basically anything that itself requires only `use standard;`) And, from an external create: - `use ethcore_util::*;` (bring in the entirety of this module and the standard dependencies) --- src/common.rs | 7 +++++++ src/lib.rs | 17 +++++++++++++++++ src/rlp/mod.rs | 4 ++-- src/rlp/{rlp.rs => rlpin.rs} | 0 src/standard.rs | 21 +++++++++++++++++++++ 5 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 src/common.rs rename src/rlp/{rlp.rs => rlpin.rs} (100%) create mode 100644 src/standard.rs diff --git a/src/common.rs b/src/common.rs new file mode 100644 index 000000000..39294155c --- /dev/null +++ b/src/common.rs @@ -0,0 +1,7 @@ +pub use standard::*; +pub use error::*; +pub use hash::*; +pub use uint::*; +pub use bytes::*; +pub use vector::*; +pub use sha3::*; diff --git a/src/lib.rs b/src/lib.rs index 4859a8580..7cc4c35eb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -48,6 +48,8 @@ extern crate secp256k1; extern crate arrayvec; extern crate elastic_array; +pub mod standard; +pub mod common; pub mod error; pub mod hash; pub mod uint; @@ -68,4 +70,19 @@ pub mod heapsizeof; pub mod squeeze; pub mod semantic_version; +pub use common::*; +pub use rlp::*; +pub use hashdb::*; +pub use memorydb::*; +pub use overlaydb::*; +pub use math::*; +pub use chainfilter::*; +pub use crypto::*; +pub use triehash::*; +pub use trie::*; +pub use nibbleslice::*; +pub use heapsizeof::*; +pub use squeeze::*; +pub use semantic_version::*; + //pub mod network; diff --git a/src/rlp/mod.rs b/src/rlp/mod.rs index 9c15259bd..bc2318fc4 100644 --- a/src/rlp/mod.rs +++ b/src/rlp/mod.rs @@ -32,7 +32,7 @@ pub mod rlptraits; pub mod rlperrors; -pub mod rlp; +pub mod rlpin; pub mod untrusted_rlp; pub mod rlpstream; @@ -42,7 +42,7 @@ mod tests; pub use self::rlperrors::DecoderError; pub use self::rlptraits::{Decoder, Decodable, View, Stream, Encodable, Encoder}; pub use self::untrusted_rlp::{UntrustedRlp, UntrustedRlpIterator, PayloadInfo, Prototype}; -pub use self::rlp::{Rlp, RlpIterator}; +pub use self::rlpin::{Rlp, RlpIterator}; pub use self::rlpstream::{RlpStream}; use super::hash::H256; diff --git a/src/rlp/rlp.rs b/src/rlp/rlpin.rs similarity index 100% rename from src/rlp/rlp.rs rename to src/rlp/rlpin.rs diff --git a/src/standard.rs b/src/standard.rs new file mode 100644 index 000000000..b591220f3 --- /dev/null +++ b/src/standard.rs @@ -0,0 +1,21 @@ +pub use std::io; +pub use std::str; +pub use std::fmt; +pub use std::slice; + +pub use std::path::Path; +pub use std::str::{FromStr}; +pub use std::io::{Read,Write}; +pub use std::hash::{Hash, Hasher}; +pub use std::error::Error as StdError; + +pub use std::ops::*; +pub use std::cmp::*; +pub use std::cell::*; +pub use std::collections::*; + +pub use rustc_serialize::json::Json; +pub use rustc_serialize::base64::FromBase64; +pub use rustc_serialize::hex::FromHex; + +pub use heapsize::HeapSizeOf;