@@ -1358,7 +1358,8 @@ fn write_minify_replacer<W: Write>(
13581358/// static HTML tree. Each component in the cleaned path will be passed as an
13591359/// argument to `f`. The very last component of the path (ie the file name) will
13601360/// be passed to `f` if `keep_filename` is true, and ignored otherwise.
1361- fn clean_srcpath < F > ( src_root : & Path , p : & Path , keep_filename : bool , mut f : F ) where
1361+ fn clean_srcpath < F > ( src_root : & Path , p : & Path , keep_filename : bool , mut f : F )
1362+ where
13621363 F : FnMut ( & OsStr ) ,
13631364{
13641365 // make it relative, if possible
@@ -1470,11 +1471,11 @@ impl<'a> SourceCollector<'a> {
14701471 let mut href = String :: new ( ) ;
14711472 clean_srcpath ( & self . scx . src_root , & p, false , |component| {
14721473 cur. push ( component) ;
1473- fs:: create_dir_all ( & cur) . unwrap ( ) ;
14741474 root_path. push_str ( "../" ) ;
14751475 href. push_str ( & component. to_string_lossy ( ) ) ;
14761476 href. push ( '/' ) ;
14771477 } ) ;
1478+ fs:: create_dir_all ( & cur) ?;
14781479 let mut fname = p. file_name ( )
14791480 . expect ( "source has no filename" )
14801481 . to_os_string ( ) ;
@@ -1483,7 +1484,7 @@ impl<'a> SourceCollector<'a> {
14831484 href. push_str ( & fname. to_string_lossy ( ) ) ;
14841485
14851486 let mut w = BufWriter :: new ( File :: create ( & cur) ?) ;
1486- let title = format ! ( "{} -- source" , cur. file_name( ) . unwrap ( )
1487+ let title = format ! ( "{} -- source" , cur. file_name( ) . expect ( "failed to get file name" )
14871488 . to_string_lossy( ) ) ;
14881489 let desc = format ! ( "Source to the Rust file `{}`." , filename) ;
14891490 let page = layout:: Page {
0 commit comments