()
| 37 | |
| 38 | impl Version { |
| 39 | fn read() -> Result<Version, String> { |
| 40 | let rustc = env::var_os("RUSTC").unwrap_or(OsString::from("rustc")); |
| 41 | let output = Command::new(&rustc) |
| 42 | .arg("--version") |
| 43 | .output() |
| 44 | .unwrap() |
| 45 | .stdout; |
| 46 | Version::parse(&String::from_utf8(output).unwrap()) |
| 47 | } |
| 48 | |
| 49 | fn parse(mut s: &str) -> Result<Version, String> { |
| 50 | if !s.starts_with("rustc ") { |