From 3a72cddb8109ce9833e7bfbed9b5b7cf95a0f0f9 Mon Sep 17 00:00:00 2001 From: Giacomo Pasini Date: Mon, 9 Jan 2023 12:15:21 +0100 Subject: [PATCH] remove unneeded generic parameters (#39) --- nomos-services/mempool/src/lib.rs | 33 +++++++++++++++---------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/nomos-services/mempool/src/lib.rs b/nomos-services/mempool/src/lib.rs index 50e5a6f4..5d2ffddd 100644 --- a/nomos-services/mempool/src/lib.rs +++ b/nomos-services/mempool/src/lib.rs @@ -20,12 +20,11 @@ use overwatch_rs::services::{ ServiceCore, ServiceData, ServiceId, }; -pub struct Mempool< - N: NetworkBackend + Send + Sync + 'static, - Tx: Debug + Send + Sync + 'static, - Id: Debug + Send + Sync + 'static, - P: Pool + Send + Sync + 'static, -> { +pub struct Mempool +where + P::Tx: Debug + Send + Sync + 'static, + P::Id: Debug + Send + Sync + 'static, +{ service_state: ServiceStateHandle, network_relay: Relay>, pool: P, @@ -74,26 +73,26 @@ impl Debug for MempoolMsg { impl RelayMessage for MempoolMsg {} -impl< - N: NetworkBackend + Send + Sync + 'static, - Tx: Debug + Send + Sync + 'static, - Id: Debug + Send + Sync + 'static, - P: Pool + Send + Sync + 'static, - > ServiceData for Mempool +impl ServiceData for Mempool +where + N: NetworkBackend + Send + Sync + 'static, + P: Pool + Send + Sync + 'static, + P::Id: Debug + Send + Sync + 'static, + P::Tx: Debug + Send + Sync + 'static, { const SERVICE_ID: ServiceId = "Mempool"; type Settings = (); type State = NoState; type StateOperator = NoOperator; - type Message = MempoolMsg; + type Message = MempoolMsg<

::Tx,

::Id>; } #[async_trait::async_trait] -impl ServiceCore for Mempool +impl ServiceCore for Mempool where - Tx: Debug + Send + Sync + 'static, - Id: Debug + Send + Sync + 'static, - P: Pool + Send + Sync + 'static, + P: Pool + Send + Sync + 'static, + P::Id: Debug + Send + Sync + 'static, + P::Tx: Debug + Send + Sync + 'static, N: NetworkBackend + Send + Sync + 'static, { fn init(service_state: ServiceStateHandle) -> Result {