cargo fmt

This commit is contained in:
Monica Moniot
2023-08-18 12:00:34 -04:00
parent bdd85155a3
commit 88618287af
2 changed files with 14 additions and 4 deletions
+7 -2
View File
@@ -12,7 +12,7 @@ impl<'a, TL: TransportLayer<SendData>, 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<SendData, RecvData, const CAP: usize> SeqEx<SendData, RecvData, CAP> {
Err(e) => Err(e),
}
}
pub fn try_send_with(&mut self, mut app: impl TransportLayer<SendData>, locked: bool, packet_data: impl FnOnce(SeqNo) -> SendData) -> Result<(), ()> {
pub fn try_send_with(
&mut self,
mut app: impl TransportLayer<SendData>,
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);
+7 -2
View File
@@ -27,7 +27,7 @@ impl<'a, TL: TransportLayer<SendData>, 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<SendData, RecvData, const CAP: usize> SeqExSync<SendData, RecvData, CAP> {
pub fn send_locked_with(&self, app: impl TransportLayer<SendData>, packet_data: impl FnMut(SeqNo) -> SendData) {
self.send_with_inner(app, true, packet_data)
}
pub fn try_send_with<TL: TransportLayer<SendData>>(&self, app: TL, locked: bool, packet_data: impl FnOnce(SeqNo) -> SendData) -> Result<(), SendData> {
pub fn try_send_with<TL: TransportLayer<SendData>>(
&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))