diff options
| author | flip1995 <philipp.krones@embecosm.com> | 2021-06-03 08:41:37 +0200 |
|---|---|---|
| committer | flip1995 <philipp.krones@embecosm.com> | 2021-06-03 08:41:37 +0200 |
| commit | 6c2748211565773c297560f2edcd762565f1933a (patch) | |
| tree | ea7c9f33926e8df2be4f551514090d804651acb7 /rustc_tools_util | |
| parent | 91aa82174531ef408c81325e0d31b508c1f26e0b (diff) | |
| download | rust-6c2748211565773c297560f2edcd762565f1933a.tar.gz rust-6c2748211565773c297560f2edcd762565f1933a.zip | |
Merge commit '3ae8faff4d46ad92f194c2a4b941c3152a701b31' into clippyup
Diffstat (limited to 'rustc_tools_util')
| -rw-r--r-- | rustc_tools_util/src/lib.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/rustc_tools_util/src/lib.rs b/rustc_tools_util/src/lib.rs index ff2a7de5725..5f289918a7c 100644 --- a/rustc_tools_util/src/lib.rs +++ b/rustc_tools_util/src/lib.rs @@ -100,9 +100,9 @@ pub fn get_commit_date() -> Option<String> { } #[must_use] -pub fn get_channel() -> Option<String> { +pub fn get_channel() -> String { match env::var("CFG_RELEASE_CHANNEL") { - Ok(channel) => Some(channel), + Ok(channel) => channel, Err(_) => { // if that failed, try to ask rustc -V, do some parsing and find out match std::process::Command::new("rustc") @@ -113,16 +113,16 @@ pub fn get_channel() -> Option<String> { { Some(rustc_output) => { if rustc_output.contains("beta") { - Some(String::from("beta")) + String::from("beta") } else if rustc_output.contains("stable") { - Some(String::from("stable")) + String::from("stable") } else { // default to nightly if we fail to parse - Some(String::from("nightly")) + String::from("nightly") } }, // default to nightly - None => Some(String::from("nightly")), + None => String::from("nightly"), } }, } |
