fix: remove needless use of itertools (#11029)
* Remove needless use of `itertools` in `ethcore-light`
* Replace `itertools:🔁:call` with `std::iter::repeat_with`
This commit is contained in:
parent
680807e601
commit
a4969ca498
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -1182,7 +1182,6 @@ dependencies = [
|
||||
"fastmap 0.1.0",
|
||||
"futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hash-db 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"journaldb 0.2.0",
|
||||
"keccak-hash 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"keccak-hasher 0.1.1",
|
||||
|
@ -1506,7 +1506,7 @@ impl Engine for AuthorityRound {
|
||||
|
||||
let mut hash = *chain_head.parent_hash();
|
||||
|
||||
let mut ancestry = itertools::repeat_call(move || {
|
||||
let mut ancestry = std::iter::repeat_with(move || {
|
||||
chain(hash).and_then(|header| {
|
||||
if header.number() == 0 { return None }
|
||||
hash = *header.parent_hash();
|
||||
@ -1548,7 +1548,7 @@ impl Engine for AuthorityRound {
|
||||
// to construct transition proof. author == ec_recover(sig) known
|
||||
// since the blocks are in the DB.
|
||||
let mut hash = chain_head.hash();
|
||||
let mut finality_proof: Vec<_> = itertools::repeat_call(move || {
|
||||
let mut finality_proof: Vec<_> = std::iter::repeat_with(move || {
|
||||
chain(hash).and_then(|header| {
|
||||
hash = *header.parent_hash();
|
||||
if header.number() == 0 { None }
|
||||
|
@ -34,7 +34,6 @@ rlp_derive = { path = "../../util/rlp-derive" }
|
||||
smallvec = "0.6"
|
||||
futures = "0.1"
|
||||
rand = "0.6"
|
||||
itertools = "0.5"
|
||||
bincode = "1.1"
|
||||
serde = "1.0"
|
||||
serde_derive = "1.0"
|
||||
|
@ -550,7 +550,7 @@ impl HeaderChain {
|
||||
let canon = &era_entry.candidates[0];
|
||||
(canon.hash, canon.total_difficulty)
|
||||
};
|
||||
cht::compute_root(cht_num, ::itertools::repeat_call(iter))
|
||||
cht::compute_root(cht_num, std::iter::repeat_with(iter))
|
||||
.expect("fails only when too few items; this is checked; qed")
|
||||
};
|
||||
|
||||
|
@ -67,11 +67,9 @@ extern crate ethereum_types;
|
||||
extern crate ethcore_miner as miner;
|
||||
extern crate hash_db;
|
||||
extern crate parity_util_mem;
|
||||
extern crate parity_util_mem as mem;
|
||||
extern crate parity_util_mem as malloc_size_of;
|
||||
extern crate failsafe;
|
||||
extern crate futures;
|
||||
extern crate itertools;
|
||||
extern crate keccak_hasher;
|
||||
extern crate machine;
|
||||
extern crate memory_db;
|
||||
|
Loading…
Reference in New Issue
Block a user