From 1d71b7e90ccda4aee7730a24698413fa760c285a Mon Sep 17 00:00:00 2001 From: Vladislav Yaroslavlev Date: Tue, 24 Feb 2026 04:07:14 +0300 Subject: [PATCH] fix: add missing imports in test code - Add ProxyError import and fix Result type annotation in tls.rs - Add Arc import in stats/mod.rs test module - Add BodyExt import in metrics.rs test module These imports were missing causing compilation failures in cargo test --release with 10 errors. --- src/metrics.rs | 1 + src/protocol/tls.rs | 3 ++- src/stats/mod.rs | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/metrics.rs b/src/metrics.rs index 620840d..53ddd5d 100644 --- a/src/metrics.rs +++ b/src/metrics.rs @@ -229,6 +229,7 @@ fn render_metrics(stats: &Stats) -> String { #[cfg(test)] mod tests { use super::*; + use http_body_util::BodyExt; #[test] fn test_render_metrics_format() { diff --git a/src/protocol/tls.rs b/src/protocol/tls.rs index f124c46..c02c8b4 100644 --- a/src/protocol/tls.rs +++ b/src/protocol/tls.rs @@ -7,6 +7,7 @@ #![allow(dead_code)] use crate::crypto::{sha256_hmac, SecureRandom}; +use crate::error::ProxyError; use super::constants::*; use std::time::{SystemTime, UNIX_EPOCH}; use num_bigint::BigUint; @@ -614,7 +615,7 @@ pub fn parse_tls_record_header(header: &[u8; 5]) -> Option<(u8, u16)> { /// /// This is useful for testing that our ServerHello is well-formed. #[cfg(test)] -fn validate_server_hello_structure(data: &[u8]) -> Result<()> { +fn validate_server_hello_structure(data: &[u8]) -> Result<(), ProxyError> { if data.len() < 5 { return Err(ProxyError::InvalidTlsRecord { record_type: 0, diff --git a/src/stats/mod.rs b/src/stats/mod.rs index 3169f1d..31e9d4f 100644 --- a/src/stats/mod.rs +++ b/src/stats/mod.rs @@ -497,6 +497,7 @@ impl ReplayStats { #[cfg(test)] mod tests { use super::*; + use std::sync::Arc; #[test] fn test_stats_shared_counters() {