From 9f539ce3c5d8be4959952bcfb88822e4f9f3e321 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Sun, 12 Apr 2026 09:14:27 +0000 Subject: [PATCH] Apply cargo fmt to node module and handshake tests Exposed by the rustfmt toolchain-pin fix now that rustfmt runs under the pinned 1.94.1 toolchain in CI. Mechanical formatting changes: - src/node/mod.rs: collapse EthernetTransport::new let-binding onto one line (fits within width limit) - src/node/tests/handshake.rs: reorder imports (super::* after specific import) and expand two assert_eq! calls to multi-line form --- src/node/mod.rs | 3 +-- src/node/tests/handshake.rs | 14 +++++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/node/mod.rs b/src/node/mod.rs index 87eaa22..0b085a6 100644 --- a/src/node/mod.rs +++ b/src/node/mod.rs @@ -734,8 +734,7 @@ impl Node { for (name, eth_config) in eth_instances { let transport_id = self.allocate_transport_id(); - let eth = - EthernetTransport::new(transport_id, name, eth_config, packet_tx.clone()); + let eth = EthernetTransport::new(transport_id, name, eth_config, packet_tx.clone()); transports.push(TransportHandle::Ethernet(eth)); } } diff --git a/src/node/tests/handshake.rs b/src/node/tests/handshake.rs index 6775443..2d2ce30 100644 --- a/src/node/tests/handshake.rs +++ b/src/node/tests/handshake.rs @@ -1,7 +1,7 @@ //! Integration tests for end-to-end Noise XX handshake scenarios. -use super::*; use super::spanning_tree::{cleanup_nodes, drain_all_packets, initiate_handshake, make_test_node}; +use super::*; #[tokio::test] async fn test_two_node_handshake_udp() { @@ -1089,8 +1089,16 @@ async fn test_xx_duplicate_msg1_resends_msg2() { }; node_b.handle_msg1(first_packet).await; - assert_eq!(node_b.connection_count(), 1, "B: 1 connection after first msg1"); - assert_eq!(node_b.peer_count(), 0, "B: 0 peers (XX, no promotion at msg1)"); + assert_eq!( + node_b.connection_count(), + 1, + "B: 1 connection after first msg1" + ); + assert_eq!( + node_b.peer_count(), + 0, + "B: 0 peers (XX, no promotion at msg1)" + ); // Duplicate msg1 from same address → dedup triggers msg2 resend, not new handshake let dup_packet = ReceivedPacket {