Skip to content

Commit

Permalink
Fix 1.34 support
Browse files Browse the repository at this point in the history
  • Loading branch information
jyn514 authored and sunfishcode committed Jul 14, 2020
1 parent b97f773 commit 7ae5d5d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<i32>().ok()
std::str::from_utf8(&stdout).ok()?.split(' ').nth(1)?.split('.').nth(1)?.parse::<i32>().ok()
})() {
Some(version) => version >= 40,
None => true, // assume we're using an up-to-date compiler
Expand Down

0 comments on commit 7ae5d5d

Please sign in to comment.