From 4ade5df0e55d27e1e522815bd4774a6e89f32215 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Mon, 8 Feb 2021 16:18:31 +1100 Subject: [PATCH] Remove unnecessary impl block --- swap/src/protocol/alice/event_loop.rs | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/swap/src/protocol/alice/event_loop.rs b/swap/src/protocol/alice/event_loop.rs index f1306cc1..bc435a24 100644 --- a/swap/src/protocol/alice/event_loop.rs +++ b/swap/src/protocol/alice/event_loop.rs @@ -25,16 +25,10 @@ pub struct Channels { receiver: Receiver, } -impl Channels { - pub fn new() -> Channels { - let (sender, receiver) = tokio::sync::mpsc::channel(100); - Channels { sender, receiver } - } -} - impl Default for Channels { fn default() -> Self { - Self::new() + let (sender, receiver) = tokio::sync::mpsc::channel(100); + Channels { sender, receiver } } } @@ -154,14 +148,14 @@ impl EventLoop { Swarm::listen_on(&mut swarm, listen.clone()) .with_context(|| format!("Address is not supported: {:#}", listen))?; - let start_execution_setup = Channels::new(); - let done_execution_setup = Channels::new(); - let recv_encrypted_signature = Channels::new(); - let request = Channels::new(); - let conn_established = Channels::new(); - let send_swap_response = Channels::new(); - let send_transfer_proof = Channels::new(); - let recv_transfer_proof_ack = Channels::new(); + let start_execution_setup = Channels::default(); + let done_execution_setup = Channels::default(); + let recv_encrypted_signature = Channels::default(); + let request = Channels::default(); + let conn_established = Channels::default(); + let send_swap_response = Channels::default(); + let send_transfer_proof = Channels::default(); + let recv_transfer_proof_ack = Channels::default(); let driver = EventLoop { swarm,