From 407fa3f40d173c93b3c5357ef0c966e2025a7a36 Mon Sep 17 00:00:00 2001 From: 0x676e67 Date: Wed, 7 Aug 2024 11:11:38 +0800 Subject: [PATCH 1/2] Add conditional compilation for `interface` field in Config struct. --- src/client/legacy/connect/http.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/client/legacy/connect/http.rs b/src/client/legacy/connect/http.rs index 6af9e98..12fb124 100644 --- a/src/client/legacy/connect/http.rs +++ b/src/client/legacy/connect/http.rs @@ -76,6 +76,7 @@ struct Config { reuse_address: bool, send_buffer_size: Option, recv_buffer_size: Option, + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] interface: Option, } @@ -179,6 +180,7 @@ impl HttpConnector { reuse_address: false, send_buffer_size: None, recv_buffer_size: None, + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] interface: None, }), resolver, @@ -1117,6 +1119,7 @@ mod tests { enforce_http: false, send_buffer_size: None, recv_buffer_size: None, + #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] interface: None, }; let connecting_tcp = ConnectingTcp::new(dns::SocketAddrs::new(addrs), &cfg); From 3560c83ef84704b7e2575a63f8d307a299c46efa Mon Sep 17 00:00:00 2001 From: 0x676e67 Date: Wed, 7 Aug 2024 11:14:03 +0800 Subject: [PATCH 2/2] cargo fmt --all --- src/client/legacy/connect/http.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/client/legacy/connect/http.rs b/src/client/legacy/connect/http.rs index 12fb124..f8c9366 100644 --- a/src/client/legacy/connect/http.rs +++ b/src/client/legacy/connect/http.rs @@ -1119,7 +1119,11 @@ mod tests { enforce_http: false, send_buffer_size: None, recv_buffer_size: None, - #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] + #[cfg(any( + target_os = "android", + target_os = "fuchsia", + target_os = "linux" + ))] interface: None, }; let connecting_tcp = ConnectingTcp::new(dns::SocketAddrs::new(addrs), &cfg);