chore(client): place the use of new rust features behind cfg

This commit is contained in:
Niv Kaminer
2018-08-04 10:21:57 +03:00
committed by Sean McArthur
parent 97f4243a59
commit 9f8add6056
5 changed files with 83 additions and 1 deletions

14
build.rs Normal file
View File

@@ -0,0 +1,14 @@
extern crate rustc_version;
use rustc_version::{version, Version};
fn main() {
// Check for a minimum version to see if new rust features can be used
let version = version().unwrap();
if version >= Version::parse("1.26.0").unwrap() {
println!("cargo:rustc-cfg=impl_trait_available");
}
if version >= Version::parse("1.23.0").unwrap() {
println!("cargo:rustc-cfg=inherent_ascii");
}
}