diff --git a/chain/src/consume_orphan.rs b/chain/src/consume_orphan.rs index 8bcedc3a76..612d7ae582 100644 --- a/chain/src/consume_orphan.rs +++ b/chain/src/consume_orphan.rs @@ -3,7 +3,7 @@ use crate::utils::orphan_block_pool::OrphanBlockPool; use crate::{LonelyBlock, LonelyBlockHash}; use ckb_channel::{select, Receiver, Sender}; -use ckb_error::{Error, InternalErrorKind}; +use ckb_error::Error; use ckb_logger::internal::trace; use ckb_logger::{debug, error, info}; use ckb_shared::block_status::BlockStatus; diff --git a/chain/src/utils/orphan_block_pool.rs b/chain/src/utils/orphan_block_pool.rs index 7556f6d6c7..ff6dd63b49 100644 --- a/chain/src/utils/orphan_block_pool.rs +++ b/chain/src/utils/orphan_block_pool.rs @@ -38,7 +38,7 @@ impl InnerPool { let parent_hash = lonely_block.block().data().header().raw().parent_hash(); self.blocks .entry(parent_hash.clone()) - .or_insert_with(HashMap::default) + .or_default() .insert(hash.clone(), lonely_block); // Out-of-order insertion needs to be deduplicated self.leaders.remove(&hash); diff --git a/util/metrics/src/lib.rs b/util/metrics/src/lib.rs index 990a8b0800..1cd4827d68 100644 --- a/util/metrics/src/lib.rs +++ b/util/metrics/src/lib.rs @@ -6,10 +6,6 @@ //! //! [`ckb-metrics-service`]: ../ckb_metrics_service/index.html -use prometheus::{ - register_histogram, register_histogram_vec, register_int_counter, register_int_gauge, - register_int_gauge_vec, Histogram, HistogramVec, IntCounter, IntGauge, IntGaugeVec, -}; use prometheus_static_metric::make_static_metric; use std::cell::Cell;