From 41abbad3ca972967a7c35a2016533f3f7b9fa3bb Mon Sep 17 00:00:00 2001 From: Monica Moniot Date: Thu, 12 Oct 2023 15:26:31 -0400 Subject: [PATCH] cargo fmt --- performance/src/application.rs | 5 ++++- performance/src/proto.rs | 2 +- performance/src/zssp.rs | 12 ++---------- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/performance/src/application.rs b/performance/src/application.rs index 225460f..88845f5 100644 --- a/performance/src/application.rs +++ b/performance/src/application.rs @@ -306,7 +306,10 @@ pub trait Sender { /// /// Is implemented by `FnMut(&Arc>) -> Option<(Sender, usize)>` closures. pub trait SendTo { - type Sender<'a>: Sender where Crypto: 'a, Self: 'a; + type Sender<'a>: Sender + where + Crypto: 'a, + Self: 'a; /// Attempt to process and borrow the resources necessary to repeatedly send fragments of a /// packet to the given session. /// diff --git a/performance/src/proto.rs b/performance/src/proto.rs index a27579f..b64ad0b 100644 --- a/performance/src/proto.rs +++ b/performance/src/proto.rs @@ -13,7 +13,7 @@ pub const MIN_TRANSPORT_MTU: usize = 128; /// the maximum transmission unit, that is passed to `Context::send`. Keep in mind that `mtu` must /// be above `MIN_TRANSPORT_MTU` or else `Context::send` would return `Err(SendError::MtuTooSmall). pub const fn max_sendable_len(mtu: usize) -> usize { - (mtu - HEADER_SIZE)*MAX_FRAGMENTS - AES_GCM_TAG_SIZE + (mtu - HEADER_SIZE) * MAX_FRAGMENTS - AES_GCM_TAG_SIZE } pub(crate) const KID_SIZE: usize = 4; diff --git a/performance/src/zssp.rs b/performance/src/zssp.rs index 9676265..20dce0e 100644 --- a/performance/src/zssp.rs +++ b/performance/src/zssp.rs @@ -625,11 +625,7 @@ impl Context { /// /// * `app` - Interface to application using ZSSP /// * `send_to` - Function to get a sender and an MTU to send something over an active session - pub fn service>( - &self, - mut app: App, - send_to: impl SendTo, - ) -> i64 { + pub fn service>(&self, mut app: App, send_to: impl SendTo) -> i64 { let current_time = app.time(); let next_service_time = self.service_inner(app, send_to, current_time); let max_interval = Crypto::SETTINGS @@ -652,11 +648,7 @@ impl Context { /// /// * `app` - Interface to application using ZSSP /// * `send_to` - Function to get a sender and an MTU to send something over an active session - pub fn service_scheduled>( - &self, - mut app: App, - send_to: impl SendTo, - ) -> i64 { + pub fn service_scheduled>(&self, mut app: App, send_to: impl SendTo) -> i64 { let current_time = app.time(); self.service_inner(app, send_to, current_time) }