diff --git a/build.rs b/build.rs index 6c45778f..167db9ec 100644 --- a/build.rs +++ b/build.rs @@ -156,9 +156,7 @@ fn byte_array_to_os_string(bytes: &[u8]) -> OsString { // Execute an R script and return the captured output fn r_command>(r_binary: S, script: &str) -> io::Result { - let out = Command::new(r_binary) - .args(&["-s", "-e", script]) - .output()?; + let out = Command::new(r_binary).args(["-s", "-e", script]).output()?; // if there are any errors we print them out, helps with debugging if !out.stderr.is_empty() { @@ -220,7 +218,7 @@ fn get_r_include(r_home: &Path, library: &Path) -> io::Result { } .get_r_binary(); - let rout = r_command(&r_binary, r#"cat(normalizePath(R.home('include')))"#)?; + let rout = r_command(r_binary, r#"cat(normalizePath(R.home('include')))"#)?; if !rout.is_empty() { Ok(PathBuf::from(rout)) } else { @@ -266,7 +264,7 @@ fn parse_r_version(r_version: String) -> Result { // Bad: // - "4.1.foo" (some part contains any non-digit characters) // - "4.1." (some part is missing) - if !s.is_empty() && s.chars().all(|c| c.is_digit(10)) { + if !s.is_empty() && s.chars().all(|c| c.is_ascii_digit()) { Some(s) } else { None @@ -330,8 +328,8 @@ fn get_r_version_from_r(r_paths: &InstallationPaths) -> Result