Skip to content

Commit 7dd356d

Browse files
committed
Eat dogfood
1 parent c51472b commit 7dd356d

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ fn main() {
1414
);
1515
println!(
1616
"cargo:rustc-env=RUSTC_RELEASE_CHANNEL={}",
17-
rustc_tools_util::get_channel().unwrap_or_default()
17+
rustc_tools_util::get_channel()
1818
);
1919
}

rustc_tools_util/src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ pub fn get_commit_date() -> Option<String> {
100100
}
101101

102102
#[must_use]
103-
pub fn get_channel() -> Option<String> {
103+
pub fn get_channel() -> String {
104104
match env::var("CFG_RELEASE_CHANNEL") {
105-
Ok(channel) => Some(channel),
105+
Ok(channel) => channel,
106106
Err(_) => {
107107
// if that failed, try to ask rustc -V, do some parsing and find out
108108
match std::process::Command::new("rustc")
@@ -113,16 +113,16 @@ pub fn get_channel() -> Option<String> {
113113
{
114114
Some(rustc_output) => {
115115
if rustc_output.contains("beta") {
116-
Some(String::from("beta"))
116+
String::from("beta")
117117
} else if rustc_output.contains("stable") {
118-
Some(String::from("stable"))
118+
String::from("stable")
119119
} else {
120120
// default to nightly if we fail to parse
121-
Some(String::from("nightly"))
121+
String::from("nightly")
122122
}
123123
},
124124
// default to nightly
125-
None => Some(String::from("nightly")),
125+
None => String::from("nightly"),
126126
}
127127
},
128128
}

0 commit comments

Comments
 (0)