refactor(lib): remove build script detecting rust >= 1.34

This commit is contained in:
Sean McArthur
2019-07-10 10:23:48 -07:00
parent c2a539783d
commit 8d4ae27b42
3 changed files with 3 additions and 19 deletions

View File

@@ -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"

View File

@@ -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");
}
}

View File

@@ -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<Uri> for Destination {
type Error = crate::error::Error;
@@ -538,7 +537,6 @@ 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");
@@ -546,7 +544,6 @@ mod tests {
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");