fix(proxy): 修复 Clippy dead_code 与 too_many_arguments 警告

This commit is contained in:
fawney19
2026-04-12 16:19:23 +08:00
parent e029012f73
commit f84febbf89
3 changed files with 6 additions and 0 deletions

View File

@@ -233,6 +233,7 @@ pub async fn run(mut config: Config, servers: Vec<ServerEntry>) -> anyhow::Resul
Ok(())
}
#[allow(clippy::too_many_arguments)]
async fn spawn_registration_recovery_tasks(
state: Arc<AppState>,
server_contexts: Arc<Mutex<Vec<Arc<ServerContext>>>>,
@@ -272,6 +273,7 @@ async fn spawn_registration_recovery_tasks(
/// Background task that retries registration for a single server until either
/// registration succeeds or shutdown is requested.
#[allow(clippy::too_many_arguments)]
async fn retry_failed_registration(
state: Arc<AppState>,
server_contexts: Arc<Mutex<Vec<Arc<ServerContext>>>>,

View File

@@ -39,6 +39,7 @@ const DELEGATE_TO_UPSTREAM: &[(&str, &str)] = &[
/// 307/308 redirects. Kept aligned with the current admin-side request size
/// default, but exposed as an independent proxy transport budget.
pub const DEFAULT_HEARTBEAT_INTERVAL_SECS: u64 = 30;
#[allow(dead_code)]
pub const DEFAULT_REDIRECT_REPLAY_BUDGET_BYTES: usize = 5_242_880;
pub const DEFAULT_REDIRECT_REPLAY_BUDGET_HUMAN: &str = "5M";
pub const DEFAULT_LOG_RETENTION_DAYS: u64 = 7;

View File

@@ -362,6 +362,7 @@ fn resolve_redirect<B>(
}
}
#[allow(clippy::too_many_arguments)]
async fn execute_upstream_request(
state: &AppState,
server: &ServerContext,
@@ -455,6 +456,7 @@ async fn execute_upstream_request(
})
}
#[allow(clippy::too_many_arguments)]
async fn relay_upstream_response(
server: &ServerContext,
stream_id: u32,
@@ -577,6 +579,7 @@ async fn relay_upstream_response(
Some(total_elapsed)
}
#[cfg(test)]
fn upstream_client_for_request<'a>(
state: &'a AppState,
meta: &RequestMeta,