File tree 2 files changed +7
-8
lines changed
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 {
430
430
t ! ( fs:: create_dir_all( & out) ) ;
431
431
t ! ( fs:: copy( builder. src. join( "src/doc/rust.css" ) , out. join( "rust.css" ) ) ) ;
432
432
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(
435
435
out. join( "version-switcher.js" ) ,
436
436
content. replace( "/* VERSION TO BE REPLACED */" , & builder. version) ,
437
- )
438
- . unwrap ( ) ;
437
+ ) ) ;
439
438
440
439
let index_page = builder. src . join ( "src/doc/index.md" ) . into_os_string ( ) ;
441
440
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 */";
2
2
3
3
function checkIfIsOldVersion ( ) {
4
4
if ( [ "http:" , "https:" ] . indexOf ( window . location . protocol ) === - 1 ) {
5
- return ;
5
+ return false ;
6
6
}
7
7
const parts = window . location . pathname . split ( "/" ) ;
8
8
@@ -155,9 +155,9 @@ function showSwitcher(isOldVersion) {
155
155
const current_doc_version = window . location . pathname . split ( "/" ) [ 1 ] ;
156
156
const version_picker = document . createElement ( "select" ) ;
157
157
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" ) ) ;
161
161
162
162
const version_parts = CURRENT_VERSION . split ( "." ) ;
163
163
for ( let major = parseInt ( version_parts [ 0 ] ) ; major >= 1 ; -- major ) {
You can’t perform that action at this time.
0 commit comments