diff --git a/Cargo.toml b/Cargo.toml index cf014bfa..9e31ef7c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ include = [ "Cargo.toml", "LICENSE", "src/**/*", - "build.rs", + #"build.rs", ] [dependencies] @@ -47,9 +47,6 @@ tokio-threadpool = { git = "https://github.com/tokio-rs/tokio", optional = true tokio-timer = { git = "https://github.com/tokio-rs/tokio", optional = true } want = { git = "https://github.com/seanmonstar/want", branch = "std-future" } -[build-dependencies] -rustc_version = "0.2" - [dev-dependencies] #futures-timer = "0.1" num_cpus = "1.0" diff --git a/build.rs b/build.rs deleted file mode 100644 index 9eaf4a71..00000000 --- a/build.rs +++ /dev/null @@ -1,10 +0,0 @@ -extern crate rustc_version; - -use rustc_version::{version, Version}; - -fn main() { - let version = version().unwrap(); - if version >= Version::parse("1.34.0").unwrap() { - println!("cargo:rustc-cfg=try_from"); - } -} diff --git a/src/client/connect/mod.rs b/src/client/connect/mod.rs index 0b4ee481..3461493f 100644 --- a/src/client/connect/mod.rs +++ b/src/client/connect/mod.rs @@ -5,9 +5,9 @@ //! - A default [`HttpConnector`](HttpConnector) that does DNS resolution and //! establishes connections over TCP. //! - The [`Connect`](Connect) trait and related types to build custom connectors. +use std::convert::TryFrom; use std::error::Error as StdError; use std::{fmt, mem}; -#[cfg(try_from)] use std::convert::TryFrom; use bytes::{BufMut, Bytes, BytesMut}; use ::http::{uri, Response, Uri}; @@ -253,7 +253,6 @@ impl Destination { */ } -#[cfg(try_from)] impl TryFrom for Destination { type Error = crate::error::Error; @@ -538,15 +537,13 @@ mod tests { assert_eq!(dst.port(), None); } - #[cfg(try_from)] #[test] fn test_try_from_destination() { let uri: http::Uri = "http://hyper.rs".parse().expect("initial parse"); let result = Destination::try_from(uri); assert_eq!(result.is_ok(), true); } - - #[cfg(try_from)] + #[test] fn test_try_from_no_scheme() { let uri: http::Uri = "hyper.rs".parse().expect("initial parse error");