refactor(proto): Remove unused protocol flags and helper functions

This commit is contained in:
Nils Andreas Svee committed 2026-05-10 20:56:43 +07:00
1 parent a5e8c80ecb
commit 04ebaf829a
2 files changed
+3 -11

No files matched your search

+1 -6
View File
@@ -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::*;
+2 -5
View File
@@ -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 {