Skip to content

Commit

Permalink
rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
surban committed Jul 5, 2023
1 parent e65583b commit 79a899a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
4 changes: 3 additions & 1 deletion aggligator-util/src/transport/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,9 @@ impl AcceptingTransport for TcpAcceptor {

// Find local interface.
let Some(interface) = local_interface_for_ip(local.ip())? else {
tracing::warn!("Interface for incoming connection from {remote} to {local} not found, rejecting.");
tracing::warn!(
"Interface for incoming connection from {remote} to {local} not found, rejecting."
);
continue;
};

Expand Down
4 changes: 2 additions & 2 deletions aggligator/src/agg/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1412,7 +1412,7 @@ where

// Extract message and link used for sending.
let mut status = packet.status.borrow_mut();
let SentReliableStatus::ResendQueued {msg: reliable_msg} = &*status else {
let SentReliableStatus::ResendQueued { msg: reliable_msg } = &*status else {
unreachable!("message was not queued for resending")
};

Expand Down Expand Up @@ -1815,7 +1815,7 @@ where

/// Sends statistics data.
fn send_stats(&mut self) {
let Some (interval) = self.cfg.stats_intervals.iter().min() else { return };
let Some(interval) = self.cfg.stats_intervals.iter().min() else { return };
if self.stats_last_sent.elapsed() >= *interval {
self.stats_last_sent = Instant::now();

Expand Down
7 changes: 5 additions & 2 deletions aggligator/src/connect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,12 @@ where
server_id,
connection_id: encrypted_conn_id,
existing_connection,
user_data: remote_user_data, cfg
user_data: remote_user_data,
cfg,
} = LinkMsg::recv(&mut rx).await?
else { return Err::<_, IncomingError>(protocol_err!("expected Connect message").into()) };
else {
return Err::<_, IncomingError>(protocol_err!("expected Connect message").into());
};

let shared_secret = server_secret.diffie_hellman(&client_public_key);
let conn_id = encrypted_conn_id.decrypt(&shared_secret);
Expand Down
6 changes: 4 additions & 2 deletions aggligator/src/control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,11 @@ where
public_key: server_public_key,
server_id,
cfg,
user_data: remote_user_data
user_data: remote_user_data,
} = LinkMsg::recv(&mut rx).await?
else { return Err::<_, AddLinkError>(protocol_err!("expected Welcome message").into()) };
else {
return Err::<_, AddLinkError>(protocol_err!("expected Welcome message").into());
};

let shared_secret = client_secret.diffie_hellman(&server_public_key);

Expand Down

0 comments on commit 79a899a

Please sign in to comment.