File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -430,12 +430,11 @@ impl Step for Std {
430430 t ! ( fs:: create_dir_all( & out) ) ;
431431 t ! ( fs:: copy( builder. src. join( "src/doc/rust.css" ) , out. join( "rust.css" ) ) ) ;
432432
433- let content = fs:: read_to_string ( builder. src . join ( "src/doc/version-switcher.js" ) ) . unwrap ( ) ;
434- fs:: write (
433+ let content = t ! ( fs:: read_to_string( builder. src. join( "src/doc/version-switcher.js" ) ) ) ;
434+ t ! ( fs:: write(
435435 out. join( "version-switcher.js" ) ,
436436 content. replace( "/* VERSION TO BE REPLACED */" , & builder. version) ,
437- )
438- . unwrap ( ) ;
437+ ) ) ;
439438
440439 let index_page = builder. src . join ( "src/doc/index.md" ) . into_os_string ( ) ;
441440 let switcher_script = builder. src . join ( "src/doc/switcher.inc" ) . into_os_string ( ) ;
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ const CURRENT_VERSION = "/* VERSION TO BE REPLACED */";
22
33function checkIfIsOldVersion ( ) {
44 if ( [ "http:" , "https:" ] . indexOf ( window . location . protocol ) === - 1 ) {
5- return ;
5+ return false ;
66 }
77 const parts = window . location . pathname . split ( "/" ) ;
88
@@ -155,9 +155,9 @@ function showSwitcher(isOldVersion) {
155155 const current_doc_version = window . location . pathname . split ( "/" ) [ 1 ] ;
156156 const version_picker = document . createElement ( "select" ) ;
157157
158- version_picker . appendChild ( createOption ( "stable" , false ) ) ;
159- version_picker . appendChild ( createOption ( "beta" , false ) ) ;
160- version_picker . appendChild ( createOption ( "nightly" , false ) ) ;
158+ version_picker . appendChild ( createOption ( "stable" , current_doc_version === "stable" ) ) ;
159+ version_picker . appendChild ( createOption ( "beta" , current_doc_version === "beta" ) ) ;
160+ version_picker . appendChild ( createOption ( "nightly" , current_doc_version === "nightly" ) ) ;
161161
162162 const version_parts = CURRENT_VERSION . split ( "." ) ;
163163 for ( let major = parseInt ( version_parts [ 0 ] ) ; major >= 1 ; -- major ) {
You can’t perform that action at this time.
0 commit comments