File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ use crate::html::layout;
88use crate :: html:: render:: { SharedContext , BASIC_KEYWORDS } ;
99use rustc_hir:: def_id:: LOCAL_CRATE ;
1010use rustc_span:: source_map:: FileName ;
11- use std:: ffi:: { OsStr , OsString } ;
11+ use std:: ffi:: OsStr ;
1212use std:: fs;
1313use std:: path:: { Component , Path , PathBuf } ;
1414
@@ -100,13 +100,13 @@ impl<'a> SourceCollector<'a> {
100100 } ) ;
101101 self . scx . ensure_dir ( & cur) ?;
102102
103- let src_fname =
104- String :: from ( p . file_name ( ) . expect ( "source has no filename" ) . to_string_lossy ( ) ) ;
105- let fname = OsString :: from ( src_fname . clone ( ) + ".html" ) ;
103+ let src_fname = p . file_name ( ) . expect ( "source has no filename" ) . to_os_string ( ) ;
104+ let mut fname = src_fname . clone ( ) ;
105+ fname. push ( ".html" ) ;
106106 cur. push ( & fname) ;
107107 href. push_str ( & fname. to_string_lossy ( ) ) ;
108108
109- let title = format ! ( "{} – source" , src_fname, ) ;
109+ let title = format ! ( "{} - source" , src_fname. to_string_lossy ( ) ) ;
110110 let desc = format ! ( "Source of the Rust file `{}`." , filename) ;
111111 let page = layout:: Page {
112112 title : & title,
You can’t perform that action at this time.
0 commit comments