@@ -1358,7 +1358,8 @@ fn write_minify_replacer<W: Write>(
1358
1358
/// static HTML tree. Each component in the cleaned path will be passed as an
1359
1359
/// argument to `f`. The very last component of the path (ie the file name) will
1360
1360
/// 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
1362
1363
F : FnMut ( & OsStr ) ,
1363
1364
{
1364
1365
// make it relative, if possible
@@ -1470,11 +1471,11 @@ impl<'a> SourceCollector<'a> {
1470
1471
let mut href = String :: new ( ) ;
1471
1472
clean_srcpath ( & self . scx . src_root , & p, false , |component| {
1472
1473
cur. push ( component) ;
1473
- fs:: create_dir_all ( & cur) . unwrap ( ) ;
1474
1474
root_path. push_str ( "../" ) ;
1475
1475
href. push_str ( & component. to_string_lossy ( ) ) ;
1476
1476
href. push ( '/' ) ;
1477
1477
} ) ;
1478
+ fs:: create_dir_all ( & cur) ?;
1478
1479
let mut fname = p. file_name ( )
1479
1480
. expect ( "source has no filename" )
1480
1481
. to_os_string ( ) ;
@@ -1483,7 +1484,7 @@ impl<'a> SourceCollector<'a> {
1483
1484
href. push_str ( & fname. to_string_lossy ( ) ) ;
1484
1485
1485
1486
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" )
1487
1488
. to_string_lossy( ) ) ;
1488
1489
let desc = format ! ( "Source to the Rust file `{}`." , filename) ;
1489
1490
let page = layout:: Page {
0 commit comments