File tree 2 files changed +7
-7
lines changed
2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,6 @@ fn main() {
14
14
) ;
15
15
println ! (
16
16
"cargo:rustc-env=RUSTC_RELEASE_CHANNEL={}" ,
17
- rustc_tools_util:: get_channel( ) . unwrap_or_default ( )
17
+ rustc_tools_util:: get_channel( )
18
18
) ;
19
19
}
Original file line number Diff line number Diff line change @@ -100,9 +100,9 @@ pub fn get_commit_date() -> Option<String> {
100
100
}
101
101
102
102
#[ must_use]
103
- pub fn get_channel ( ) -> Option < String > {
103
+ pub fn get_channel ( ) -> String {
104
104
match env:: var ( "CFG_RELEASE_CHANNEL" ) {
105
- Ok ( channel) => Some ( channel) ,
105
+ Ok ( channel) => channel,
106
106
Err ( _) => {
107
107
// if that failed, try to ask rustc -V, do some parsing and find out
108
108
match std:: process:: Command :: new ( "rustc" )
@@ -113,16 +113,16 @@ pub fn get_channel() -> Option<String> {
113
113
{
114
114
Some ( rustc_output) => {
115
115
if rustc_output. contains ( "beta" ) {
116
- Some ( String :: from ( "beta" ) )
116
+ String :: from ( "beta" )
117
117
} else if rustc_output. contains ( "stable" ) {
118
- Some ( String :: from ( "stable" ) )
118
+ String :: from ( "stable" )
119
119
} else {
120
120
// default to nightly if we fail to parse
121
- Some ( String :: from ( "nightly" ) )
121
+ String :: from ( "nightly" )
122
122
}
123
123
} ,
124
124
// default to nightly
125
- None => Some ( String :: from ( "nightly" ) ) ,
125
+ None => String :: from ( "nightly" ) ,
126
126
}
127
127
} ,
128
128
}
You can’t perform that action at this time.
0 commit comments