File tree 1 file changed +16
-5
lines changed
1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -398,12 +398,23 @@ pub fn main_args(args: &[String]) -> isize {
398
398
}
399
399
400
400
let mut themes = Vec :: new ( ) ;
401
- for theme in matches. opt_strs ( "themes" ) . iter ( ) . map ( |s| PathBuf :: from ( & s) ) {
402
- if !theme. is_file ( ) {
403
- eprintln ! ( "rustdoc: option --themes arguments must all be files" ) ;
404
- return 1 ;
401
+ if matches. opt_present ( "themes" ) {
402
+ let pathes = theme:: load_css_pathes ( include_bytes ! ( "html/static/themes/main.css" ) ) ;
403
+
404
+ for ( theme_file, theme_s) in matches. opt_strs ( "themes" )
405
+ . iter ( )
406
+ . map ( |s| ( PathBuf :: from ( & s) , s. to_owned ( ) ) ) {
407
+ if !theme_file. is_file ( ) {
408
+ eprintln ! ( "rustdoc: option --themes arguments must all be files" ) ;
409
+ return 1 ;
410
+ }
411
+ if !theme:: test_theme_against ( & theme_file, & pathes) . is_empty ( ) {
412
+ eprintln ! ( "rustdoc: invalid theme: \" {}\" " , theme_s) ;
413
+ eprintln ! ( " Check what's wrong with the \" theme-checker\" option" ) ;
414
+ return 1 ;
415
+ }
416
+ themes. push ( theme_file) ;
405
417
}
406
- themes. push ( theme) ;
407
418
}
408
419
409
420
let external_html = match ExternalHtml :: load (
You can’t perform that action at this time.
0 commit comments