cargo fmt

This commit is contained in:
Monica Moniot
2023-10-12 15:26:31 -04:00
parent 7de56e73ec
commit 41abbad3ca
3 changed files with 7 additions and 12 deletions
+4 -1
View File
@@ -306,7 +306,10 @@ pub trait Sender {
///
/// Is implemented by `FnMut(&Arc<Session<Crypto>>) -> Option<(Sender, usize)>` closures.
pub trait SendTo<Crypto: CryptoLayer> {
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.
///
+1 -1
View File
@@ -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;
+2 -10
View File
@@ -625,11 +625,7 @@ impl<Crypto: CryptoLayer> Context<Crypto> {
///
/// * `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<App: ApplicationLayer<Crypto>>(
&self,
mut app: App,
send_to: impl SendTo<Crypto>,
) -> i64 {
pub fn service<App: ApplicationLayer<Crypto>>(&self, mut app: App, send_to: impl SendTo<Crypto>) -> 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<Crypto: CryptoLayer> Context<Crypto> {
///
/// * `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<App: ApplicationLayer<Crypto>>(
&self,
mut app: App,
send_to: impl SendTo<Crypto>,
) -> i64 {
pub fn service_scheduled<App: ApplicationLayer<Crypto>>(&self, mut app: App, send_to: impl SendTo<Crypto>) -> i64 {
let current_time = app.time();
self.service_inner(app, send_to, current_time)
}