refactor(lib): remove build script detecting rust >= 1.34
This commit is contained in:
@@ -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"
|
||||
|
||||
10
build.rs
10
build.rs
@@ -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");
|
||||
}
|
||||
}
|
||||
@@ -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,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");
|
||||
|
||||
Reference in New Issue
Block a user