Skip to content

Commit 3b55d65

Browse files
committed
remove dead code in rustc version
1 parent e49aa39 commit 3b55d65

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

src/utils/rustc_version.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11

2-
use std::process::{Command, Output};
32
use regex::Regex;
43
use error::Result;
54
use failure::err_msg;
@@ -18,26 +17,6 @@ pub fn parse_rustc_version<S: AsRef<str>>(version: S) -> Result<String> {
1817
captures.get(2).unwrap().as_str()))
1918
}
2019

21-
22-
/// Returns current version of rustc and cratesfyi
23-
pub fn get_current_versions() -> Result<(String, String)> {
24-
let rustc_version = command_result(Command::new("rustc").arg("--version").output()?)?;
25-
let cratesfyi_version = command_result(Command::new("rustc").arg("--version").output()?)?;
26-
27-
Ok((rustc_version, cratesfyi_version))
28-
}
29-
30-
31-
pub fn command_result(output: Output) -> Result<String> {
32-
let mut command_out = String::from_utf8_lossy(&output.stdout).into_owned();
33-
command_out.push_str(&String::from_utf8_lossy(&output.stderr).into_owned()[..]);
34-
match output.status.success() {
35-
true => Ok(command_out),
36-
false => Err(err_msg(command_out)),
37-
}
38-
}
39-
40-
4120
#[test]
4221
fn test_parse_rustc_version() {
4322
assert_eq!(parse_rustc_version("rustc 1.10.0-nightly (57ef01513 2016-05-23)").unwrap(),

0 commit comments

Comments
 (0)