fix: resolve clippy warnings (matches!, map_or, redundant guard, unnecessary allocations)
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user