From 66424d4022b32e6ed29002bc21de729220ea57a7 Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Mon, 25 Dec 2023 15:03:07 +0800 Subject: [PATCH] Fix cargo clippy --- tx-pool/src/component/sort_key.rs | 12 ++++++------ util/types/src/core/tx_pool.rs | 4 ++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/tx-pool/src/component/sort_key.rs b/tx-pool/src/component/sort_key.rs index 792dbe9170..e8b1c82830 100644 --- a/tx-pool/src/component/sort_key.rs +++ b/tx-pool/src/component/sort_key.rs @@ -49,13 +49,13 @@ impl Ord for AncestorsScoreSortKey { } } -impl Into for AncestorsScoreSortKey { - fn into(self) -> CoreAncestorsScoreSortKey { +impl From for CoreAncestorsScoreSortKey { + fn from(val: AncestorsScoreSortKey) -> Self { CoreAncestorsScoreSortKey { - fee: self.fee, - weight: self.weight, - ancestors_fee: self.ancestors_fee, - ancestors_weight: self.ancestors_weight, + fee: val.fee, + weight: val.weight, + ancestors_fee: val.ancestors_fee, + ancestors_weight: val.ancestors_weight, } } } diff --git a/util/types/src/core/tx_pool.rs b/util/types/src/core/tx_pool.rs index 75b61934c1..b41630461c 100644 --- a/util/types/src/core/tx_pool.rs +++ b/util/types/src/core/tx_pool.rs @@ -348,9 +348,13 @@ pub struct TxPoolInfo { /// A struct as a sorted key in tx-pool #[derive(Eq, PartialEq, Clone, Debug, Default)] pub struct AncestorsScoreSortKey { + /// fee pub fee: Capacity, + /// weight pub weight: u64, + /// ancestors_fee pub ancestors_fee: Capacity, + /// ancestors_weight pub ancestors_weight: u64, }