MCPcopy Create free account
hub / github.com/SeaQL/FireDBG.for.Rust / rustc_version

Function rustc_version

debugger/src/version.rs:2–10  ·  view source on GitHub ↗

Get the `rustc` version *in the system*.

()

Source from the content-addressed store, hash-verified

1/// Get the `rustc` version *in the system*.
2pub fn rustc_version() -> String {
3 let rustc = std::env::var("RUSTC").unwrap_or_else(|_| "rustc".to_string());
4 let output = std::process::Command::new(rustc)
5 .arg("--version")
6 .output()
7 .unwrap();
8 let stdout = std::str::from_utf8(&output.stdout).unwrap();
9 parse_rustc_version(stdout)
10}
11
12fn parse_rustc_version(line: &str) -> String {
13 let full_version = line.split_whitespace().nth(1).expect("full version");

Callers 1

check_rustc_versionFunction · 0.85

Calls 3

parse_rustc_versionFunction · 0.85
to_stringMethod · 0.80
outputMethod · 0.45

Tested by

no test coverage detected