Skip to content

fix: add missing feature flags #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,16 @@ tower-service = "0.3"
tower = { version = "0.4", features = ["util"] }

[dev-dependencies]
tokio = { version = "1", features = ["macros"] }
tokio = { version = "1", features = ["macros", "test-util"] }

[target.'cfg(any(target_os = "linux", target_os = "macos"))'.dev-dependencies]
pnet_datalink = "0.27.2"

[features]
runtime = []
tcp = []
http1 = []
http2 = []

# internal features used in CI
__internal_happy_eyeballs_tests = []
4 changes: 2 additions & 2 deletions src/client/connect/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -549,10 +549,10 @@ fn bind_local_address(
) -> io::Result<()> {
match (*dst_addr, local_addr_ipv4, local_addr_ipv6) {
(SocketAddr::V4(_), Some(addr), _) => {
socket.bind(&SocketAddr::new(addr.clone().into(), 0).into())?;
socket.bind(&SocketAddr::new((*addr).into(), 0).into())?;
}
(SocketAddr::V6(_), _, Some(addr)) => {
socket.bind(&SocketAddr::new(addr.clone().into(), 0).into())?;
socket.bind(&SocketAddr::new((*addr).into(), 0).into())?;
}
_ => {
if cfg!(windows) {
Expand Down
2 changes: 1 addition & 1 deletion src/client/connect/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ impl Connected {
#[cfg(feature = "http2")]
pub(super) fn clone(&self) -> Connected {
Connected {
alpn: self.alpn.clone(),
alpn: self.alpn,
is_proxied: self.is_proxied,
extra: self.extra.clone(),
}
Expand Down
1 change: 0 additions & 1 deletion src/client/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,6 @@ mod tests {
#[cfg(feature = "runtime")]
#[tokio::test]
async fn test_pool_timer_removes_expired() {
let _ = pretty_env_logger::try_init();
tokio::time::pause();

let pool = Pool::new(
Expand Down
3 changes: 3 additions & 0 deletions src/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ macro_rules! ready {

pub(crate) use ready;
pub(crate) mod exec;
pub(crate) mod never;

pub(crate) use never::Never;
21 changes: 21 additions & 0 deletions src/common/never.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//! An uninhabitable type meaning it can never happen.
//!
//! To be replaced with `!` once it is stable.

use std::error::Error;
use std::fmt;

#[derive(Debug)]
pub(crate) enum Never {}

impl fmt::Display for Never {
fn fmt(&self, _: &mut fmt::Formatter<'_>) -> fmt::Result {
match *self {}
}
}

impl Error for Never {
fn description(&self) -> &str {
match *self {}
}
}