From 7369918a6280808e05f640f8a94587681fd2bdb5 Mon Sep 17 00:00:00 2001 From: Daniel Dulaney Date: Sat, 30 Nov 2019 01:28:02 -0500 Subject: [PATCH] build: upgrade build deps and fix try! warnings - upgrade num_cpus from 1.0 to 1.11 - upgrade regex from 0.2 to 1.3 - replace 3 instances of try! with ? in build.rs --- sys/Cargo.toml | 6 +++--- sys/build.rs | 20 ++++++++------------ 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/sys/Cargo.toml b/sys/Cargo.toml index f24541e..5d3f81c 100644 --- a/sys/Cargo.toml +++ b/sys/Cargo.toml @@ -15,11 +15,11 @@ keywords = ["audio", "video"] libc = "0.2" [build-dependencies] -num_cpus = "1.0" -cc = "1.0" +num_cpus = "1.11" +cc = "1.0" pkg-config = "0.3" bindgen = "0.51.1" -regex = "0.2" +regex = "1.3" [features] default = ["avcodec", "avdevice", "avfilter", "avformat", "swresample", "swscale"] diff --git a/sys/build.rs b/sys/build.rs index 2b1282c..9d2fafa 100644 --- a/sys/build.rs +++ b/sys/build.rs @@ -117,16 +117,14 @@ fn search() -> PathBuf { } fn fetch() -> io::Result<()> { - let status = try!( - Command::new("git") + let status = Command::new("git") .current_dir(&output()) .arg("clone") .arg("-b") .arg(format!("release/{}", version())) .arg("https://github.com/FFmpeg/FFmpeg") .arg(format!("ffmpeg-{}", version())) - .status() - ); + .status()?; if status.success() { Ok(()) @@ -281,24 +279,22 @@ fn build() -> io::Result<()> { } // run make - if !try!( - Command::new("make") + if !Command::new("make") .arg("-j") .arg(num_cpus::get().to_string()) .current_dir(&source()) - .status() - ).success() + .status()? + .success() { return Err(io::Error::new(io::ErrorKind::Other, "make failed")); } // run make install - if !try!( - Command::new("make") + if !Command::new("make") .current_dir(&source()) .arg("install") - .status() - ).success() + .status()? + .success() { return Err(io::Error::new(io::ErrorKind::Other, "make install failed")); }