mirror of
https://github.com/jmcorgan/fips.git
synced 2026-08-09 16:24:45 +00:00
Add rustfmt formatting policy and reformat codebase
Add rustfmt.toml with stable defaults and apply cargo fmt to all source files. This establishes a consistent formatting baseline for CI enforcement.
This commit is contained in:
+13
-4
@@ -7,10 +7,10 @@
|
||||
|
||||
use std::time::Instant;
|
||||
|
||||
use crate::NodeAddr;
|
||||
use crate::config::SessionMmpConfig;
|
||||
use crate::mmp::MmpSessionState;
|
||||
use crate::noise::{HandshakeState, NoiseSession};
|
||||
use crate::NodeAddr;
|
||||
use secp256k1::PublicKey;
|
||||
|
||||
/// State machine for an end-to-end session.
|
||||
@@ -159,12 +159,16 @@ impl SessionEntry {
|
||||
/// Get the current session state.
|
||||
#[cfg(test)]
|
||||
pub(crate) fn state(&self) -> &EndToEndState {
|
||||
self.state.as_ref().expect("session state taken but not restored")
|
||||
self.state
|
||||
.as_ref()
|
||||
.expect("session state taken but not restored")
|
||||
}
|
||||
|
||||
/// Get mutable access to the session state.
|
||||
pub(crate) fn state_mut(&mut self) -> &mut EndToEndState {
|
||||
self.state.as_mut().expect("session state taken but not restored")
|
||||
self.state
|
||||
.as_mut()
|
||||
.expect("session state taken but not restored")
|
||||
}
|
||||
|
||||
/// Replace the session state.
|
||||
@@ -278,7 +282,12 @@ impl SessionEntry {
|
||||
|
||||
/// Get traffic counters: (packets_sent, packets_recv, bytes_sent, bytes_recv).
|
||||
pub(crate) fn traffic_counters(&self) -> (u64, u64, u64, u64) {
|
||||
(self.packets_sent, self.packets_recv, self.bytes_sent, self.bytes_recv)
|
||||
(
|
||||
self.packets_sent,
|
||||
self.packets_recv,
|
||||
self.bytes_sent,
|
||||
self.bytes_recv,
|
||||
)
|
||||
}
|
||||
|
||||
// === Handshake Resend ===
|
||||
|
||||
Reference in New Issue
Block a user