From cf366bdb298bed6371b14af958efe8f4c0bea2e0 Mon Sep 17 00:00:00 2001 From: Hawstein Date: Fri, 1 Sep 2017 22:57:57 +0800 Subject: [PATCH] util should not reexport ansi_term --- Cargo.lock | 2 ++ ethcore/Cargo.toml | 1 + ethcore/src/blockchain/blockchain.rs | 1 + ethcore/src/lib.rs | 1 + ethcore/src/miner/miner.rs | 1 + ethcore/src/service.rs | 1 + parity/configuration.rs | 2 +- parity/informant.rs | 4 ++-- parity/run.rs | 3 ++- rpc/Cargo.toml | 1 + rpc/src/lib.rs | 1 + rpc/src/v1/types/confirmations.rs | 2 +- rpc/src/v1/types/transaction_request.rs | 2 +- util/src/lib.rs | 1 - 14 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 15d841103..d5a63f9df 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -492,6 +492,7 @@ dependencies = [ name = "ethcore" version = "1.8.0" dependencies = [ + "ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "bloomable 0.1.0", "bloomchain 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2013,6 +2014,7 @@ dependencies = [ name = "parity-rpc" version = "1.8.0" dependencies = [ + "ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "cid 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "ethash 1.8.0", diff --git a/ethcore/Cargo.toml b/ethcore/Cargo.toml index 6ee332c99..4741c37ee 100644 --- a/ethcore/Cargo.toml +++ b/ethcore/Cargo.toml @@ -11,6 +11,7 @@ build = "build.rs" "ethcore-ipc-codegen" = { path = "../ipc/codegen" } [dependencies] +ansi_term = "0.9" bit-set = "0.4" bloomchain = "0.1" bn = { git = "https://github.com/paritytech/bn" } diff --git a/ethcore/src/blockchain/blockchain.rs b/ethcore/src/blockchain/blockchain.rs index 022c93b8f..ac51a789e 100644 --- a/ethcore/src/blockchain/blockchain.rs +++ b/ethcore/src/blockchain/blockchain.rs @@ -41,6 +41,7 @@ use db::{self, Writable, Readable, CacheUpdatePolicy}; use cache_manager::CacheManager; use encoded; use engines::epoch::{Transition as EpochTransition, PendingTransition as PendingEpochTransition}; +use ansi_term::Colour; const LOG_BLOOMS_LEVELS: usize = 3; const LOG_BLOOMS_ELEMENTS_PER_INDEX: usize = 16; diff --git a/ethcore/src/lib.rs b/ethcore/src/lib.rs index daab42acf..6732e63c6 100644 --- a/ethcore/src/lib.rs +++ b/ethcore/src/lib.rs @@ -103,6 +103,7 @@ extern crate rand; extern crate rlp; extern crate hash; extern crate heapsize; +extern crate ansi_term; #[macro_use] extern crate rlp_derive; diff --git a/ethcore/src/miner/miner.rs b/ethcore/src/miner/miner.rs index 2fa4a76e2..1fa4508bf 100644 --- a/ethcore/src/miner/miner.rs +++ b/ethcore/src/miner/miner.rs @@ -40,6 +40,7 @@ use miner::service_transaction_checker::ServiceTransactionChecker; use price_info::{Client as PriceInfoClient, PriceInfo}; use price_info::fetch::Client as FetchClient; use header::{Header, BlockNumber}; +use ansi_term::Colour; /// Different possible definitions for pending transaction set. #[derive(Debug, PartialEq)] diff --git a/ethcore/src/service.rs b/ethcore/src/service.rs index 5e65a4de8..1be5c9a19 100644 --- a/ethcore/src/service.rs +++ b/ethcore/src/service.rs @@ -28,6 +28,7 @@ use miner::Miner; use snapshot::ManifestData; use snapshot::service::{Service as SnapshotService, ServiceParams as SnapServiceParams}; use std::sync::atomic::AtomicBool; +use ansi_term::Colour; #[cfg(feature="ipc")] use nanoipc; diff --git a/parity/configuration.rs b/parity/configuration.rs index 11360c41b..c27872905 100644 --- a/parity/configuration.rs +++ b/parity/configuration.rs @@ -25,7 +25,7 @@ use cli::{Args, ArgsError}; use hash::keccak; use util::{H256, U256, Bytes, version_data, Address}; use util::journaldb::Algorithm; -use util::Colour; +use ansi_term::Colour; use ethsync::{NetworkConfiguration, is_valid_node_url}; use ethcore::ethstore::ethkey::{Secret, Public}; use ethcore::client::{VMType}; diff --git a/parity/informant.rs b/parity/informant.rs index 1935ec9b6..4e2987892 100644 --- a/parity/informant.rs +++ b/parity/informant.rs @@ -16,7 +16,7 @@ extern crate ansi_term; use self::ansi_term::Colour::{White, Yellow, Green, Cyan, Blue}; -use self::ansi_term::Style; +use self::ansi_term::{Colour, Style}; use std::sync::{Arc}; use std::sync::atomic::{AtomicUsize, AtomicBool, Ordering as AtomicOrdering}; @@ -35,7 +35,7 @@ use light::client::LightChainClient; use number_prefix::{binary_prefix, Standalone, Prefixed}; use parity_rpc::{is_major_importing}; use parity_rpc::informant::RpcStats; -use util::{RwLock, Mutex, H256, Colour, Bytes}; +use util::{RwLock, Mutex, H256, Bytes}; /// Format byte counts to standard denominations. pub fn format_bytes(b: usize) -> String { diff --git a/parity/run.rs b/parity/run.rs index a81d61ba0..093a019f3 100644 --- a/parity/run.rs +++ b/parity/run.rs @@ -37,7 +37,8 @@ use node_health; use parity_reactor::EventLoop; use parity_rpc::{NetworkSettings, informant, is_major_importing}; use updater::{UpdatePolicy, Updater}; -use util::{Colour, version, Mutex, Condvar}; +use util::{version, Mutex, Condvar}; +use ansi_term::Colour; use node_filter::NodeFilter; use params::{ diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index 382878683..a0bbe95ca 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -8,6 +8,7 @@ authors = ["Parity Technologies "] [lib] [dependencies] +ansi_term = "0.9" cid = "0.2" futures = "0.1" futures-cpupool = "0.1" diff --git a/rpc/src/lib.rs b/rpc/src/lib.rs index 7db99ba2c..22f623bf6 100644 --- a/rpc/src/lib.rs +++ b/rpc/src/lib.rs @@ -20,6 +20,7 @@ #![cfg_attr(feature="dev", feature(plugin))] #![cfg_attr(feature="dev", plugin(clippy))] +extern crate ansi_term; extern crate cid; extern crate crypto as rust_crypto; extern crate futures; diff --git a/rpc/src/v1/types/confirmations.rs b/rpc/src/v1/types/confirmations.rs index bbc8b350e..39bf8d0a1 100644 --- a/rpc/src/v1/types/confirmations.rs +++ b/rpc/src/v1/types/confirmations.rs @@ -18,7 +18,7 @@ use std::fmt; use serde::{Serialize, Serializer}; -use util::Colour; +use ansi_term::Colour; use util::bytes::ToPretty; use v1::types::{U256, TransactionRequest, RichRawTransaction, H160, H256, H520, Bytes, TransactionCondition, Origin}; diff --git a/rpc/src/v1/types/transaction_request.rs b/rpc/src/v1/types/transaction_request.rs index cb74e071b..7f1c16287 100644 --- a/rpc/src/v1/types/transaction_request.rs +++ b/rpc/src/v1/types/transaction_request.rs @@ -18,7 +18,7 @@ use v1::types::{Bytes, H160, U256, TransactionCondition}; use v1::helpers; -use util::Colour; +use ansi_term::Colour; use std::fmt; diff --git a/util/src/lib.rs b/util/src/lib.rs index 0f16609c7..790a1c3f9 100644 --- a/util/src/lib.rs +++ b/util/src/lib.rs @@ -149,7 +149,6 @@ pub use vector::*; pub use bigint::prelude::*; pub use bigint::hash; -pub use ansi_term::{Colour, Style}; pub use parking_lot::{Condvar, Mutex, MutexGuard, RwLock, RwLockReadGuard, RwLockWriteGuard}; /// 160-bit integer representing account address