From 7ae5d5d909665f3b465030e40917b27df8f07934 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Sun, 5 Jul 2020 09:41:42 -0400 Subject: [PATCH] Fix 1.34 support --- build.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/build.rs b/build.rs index 8ecc2c1..e0c0cb4 100644 --- a/build.rs +++ b/build.rs @@ -59,10 +59,16 @@ fn main() { fn using_1_40() -> bool { match (|| { let stdout = match Command::new("rustc").arg("--version").output() { - Ok(output) if output.status.success() => output.stdout, + Ok(output) => { + if output.status.success() { + output.stdout + } else { + return None; + } + } _ => return None, }; - std::str::from_utf8(&stdout).ok()?.split(' ').nth(1)?.parse::().ok() + std::str::from_utf8(&stdout).ok()?.split(' ').nth(1)?.split('.').nth(1)?.parse::().ok() })() { Some(version) => version >= 40, None => true, // assume we're using an up-to-date compiler