From 04ebaf829aee0c45ffb186d4db8898e89aa83ccc Mon Sep 17 00:00:00 2001 From: Nils Andreas Svee Date: Tue, 28 Apr 2026 17:29:12 +0700 Subject: [PATCH] refactor(proto): Remove unused protocol flags and helper functions --- crates/irtt-proto/src/echo.rs | 7 +------ crates/irtt-proto/src/layout.rs | 7 ++----- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/crates/irtt-proto/src/echo.rs b/crates/irtt-proto/src/echo.rs index 8263d2f..69c7c3f 100644 --- a/crates/irtt-proto/src/echo.rs +++ b/crates/irtt-proto/src/echo.rs @@ -1,5 +1,5 @@ use crate::{ - flags::{has, FLAG_CLOSE, FLAG_HMAC, FLAG_OPEN, FLAG_REPLY}, + flags::{has, FLAG_HMAC, FLAG_OPEN, FLAG_REPLY}, hmac, layout::{echo_packet_len, PacketLayout}, open::{check_hmac_presence, reject}, @@ -147,11 +147,6 @@ fn read_i64(packet: &[u8], pos: &mut usize) -> i64 { value } -#[allow(dead_code)] -fn _assert_close_flag_imported(_: u8) { - let _ = FLAG_CLOSE; -} - #[cfg(test)] mod tests { use super::*; diff --git a/crates/irtt-proto/src/layout.rs b/crates/irtt-proto/src/layout.rs index 9a61623..740a3f2 100644 --- a/crates/irtt-proto/src/layout.rs +++ b/crates/irtt-proto/src/layout.rs @@ -1,5 +1,5 @@ use crate::{ - params::{Clock, Params, StampAt}, + params::{Params, StampAt}, HEADER_SIZE, HMAC_SIZE, RECV_COUNT_SIZE, RECV_WINDOW_SIZE, SEQ_SIZE, TIMESTAMP_SIZE, TOKEN_SIZE, }; @@ -117,13 +117,10 @@ pub fn echo_packet_len(hmac: bool, params: &Params) -> usize { header_len.max(requested) } -#[allow(dead_code)] -fn _assert_clock_is_used(_: Clock) {} - #[cfg(test)] mod tests { use super::*; - use crate::params::{ReceivedStats, StampAt}; + use crate::params::{Clock, ReceivedStats, StampAt}; fn params(stats: ReceivedStats, stamp_at: StampAt, clock: Clock) -> Params { Params {