fix: resolve clippy warnings (matches!, map_or, redundant guard, unnecessary allocations)

This commit is contained in:
Nikketryhard
2026-02-14 04:06:18 -06:00
parent 725bdb4e9a
commit 901cd3d2e3
7 changed files with 14 additions and 32 deletions

View File

@@ -46,6 +46,7 @@ const PASSTHROUGH_DOMAINS: &[&str] = &[
];
/// Configuration for the MITM proxy.
#[derive(Default)]
pub struct MitmConfig {
/// Port to listen on (0 = auto-assign).
pub port: u16,
@@ -53,14 +54,6 @@ pub struct MitmConfig {
pub modify_requests: bool,
}
impl Default for MitmConfig {
fn default() -> Self {
Self {
port: 0,
modify_requests: false,
}
}
}
/// Run the MITM proxy server.
///
@@ -405,7 +398,7 @@ async fn handle_http_over_tls(
async fn resolve_upstream(domain: &str) -> String {
// 1. Try dig @8.8.8.8 (bypasses /etc/hosts)
if let Ok(output) = tokio::process::Command::new("dig")
.args(["+short", &format!("@8.8.8.8"), domain])
.args(["+short", "@8.8.8.8", domain])
.output()
.await
{