File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments