From 88618287afd0e4aba617612bb2bb7c4783be5b13 Mon Sep 17 00:00:00 2001 From: Monica Moniot Date: Fri, 18 Aug 2023 12:00:34 -0400 Subject: [PATCH] cargo fmt --- src/single_thread.rs | 9 +++++++-- src/sync.rs | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/single_thread.rs b/src/single_thread.rs index 7e88d57..813754a 100644 --- a/src/single_thread.rs +++ b/src/single_thread.rs @@ -12,7 +12,7 @@ impl<'a, TL: TransportLayer, SendData, RecvData, const CAP: usize> Rep /// The identifier will tell the remote peer which packets contain fragments of the file, /// and since each fragment will be received in order it will be trivial for them to reconstruct /// the original file. - pub fn reply(self, packet_data: SendData) { + pub fn reply(self, packet_data: SendData) { self.reply_inner(false, |_, _| packet_data) } pub fn reply_locked(self, packet_data: SendData) { @@ -152,7 +152,12 @@ impl SeqEx { Err(e) => Err(e), } } - pub fn try_send_with(&mut self, mut app: impl TransportLayer, locked: bool, packet_data: impl FnOnce(SeqNo) -> SendData) -> Result<(), ()> { + pub fn try_send_with( + &mut self, + mut app: impl TransportLayer, + locked: bool, + packet_data: impl FnOnce(SeqNo) -> SendData, + ) -> Result<(), ()> { match self.try_send_direct_with(packet_data, app.time()) { Ok(mut p) => { p.set_locking(locked); diff --git a/src/sync.rs b/src/sync.rs index ebb2fd6..ecdf918 100644 --- a/src/sync.rs +++ b/src/sync.rs @@ -27,7 +27,7 @@ impl<'a, TL: TransportLayer, SendData, RecvData, const CAP: usize> Rep /// The identifier will tell the remote peer which packets contain fragments of the file, /// and since each fragment will be received in order it will be trivial for them to reconstruct /// the original file. - pub fn reply(self, packet_data: SendData) { + pub fn reply(self, packet_data: SendData) { self.reply_inner(false, |_, _| packet_data) } pub fn reply_locked(self, packet_data: SendData) { @@ -207,7 +207,12 @@ impl SeqExSync { pub fn send_locked_with(&self, app: impl TransportLayer, packet_data: impl FnMut(SeqNo) -> SendData) { self.send_with_inner(app, true, packet_data) } - pub fn try_send_with>(&self, app: TL, locked: bool, packet_data: impl FnOnce(SeqNo) -> SendData) -> Result<(), SendData> { + pub fn try_send_with>( + &self, + app: TL, + locked: bool, + packet_data: impl FnOnce(SeqNo) -> SendData, + ) -> Result<(), SendData> { let mut seq = self.lock(); let seq_no = seq.seq_no(); seq.try_send(app, locked, packet_data(seq_no))