From faf8361ad20d42a47013f8904d5fdbdc65dc637e Mon Sep 17 00:00:00 2001 From: Nicky Sielicki Date: Wed, 28 Apr 2021 22:16:12 -0500 Subject: [PATCH] avoid keyword conflict with `try!`; mute `try!` deprecation warnings --- build.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build.rs b/build.rs index 600a180..0471407 100644 --- a/build.rs +++ b/build.rs @@ -117,6 +117,7 @@ struct Version { } impl Version { + #[allow(deprecated)] // necessary for 1.10.0 compatibility with `r#try!` fn parse(mut s: &str) -> Result { if !s.starts_with("rustc ") { return Err(format!("unrecognized version string: {}", s)); @@ -135,7 +136,7 @@ impl Version { } num.push(c); } - let major = try!(num.parse::().map_err(|e| e.to_string())); + let major = r#try!(num.parse::().map_err(|e| e.to_string())); num.clear(); for c in parts[1].chars() { @@ -144,7 +145,7 @@ impl Version { } num.push(c); } - let minor = try!(num.parse::().map_err(|e| e.to_string())); + let minor = r#try!(num.parse::().map_err(|e| e.to_string())); num.clear(); for c in parts[2].chars() { @@ -153,7 +154,7 @@ impl Version { } num.push(c); } - let patch = try!(num.parse::().map_err(|e| e.to_string())); + let patch = r#try!(num.parse::().map_err(|e| e.to_string())); Ok(Version { major: major,