File tree 1 file changed +5
-5
lines changed
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;
8
8
use crate :: html:: render:: { SharedContext , BASIC_KEYWORDS } ;
9
9
use rustc_hir:: def_id:: LOCAL_CRATE ;
10
10
use rustc_span:: source_map:: FileName ;
11
- use std:: ffi:: { OsStr , OsString } ;
11
+ use std:: ffi:: OsStr ;
12
12
use std:: fs;
13
13
use std:: path:: { Component , Path , PathBuf } ;
14
14
@@ -100,13 +100,13 @@ impl<'a> SourceCollector<'a> {
100
100
} ) ;
101
101
self . scx . ensure_dir ( & cur) ?;
102
102
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" ) ;
106
106
cur. push ( & fname) ;
107
107
href. push_str ( & fname. to_string_lossy ( ) ) ;
108
108
109
- let title = format ! ( "{} – source" , src_fname, ) ;
109
+ let title = format ! ( "{} - source" , src_fname. to_string_lossy ( ) ) ;
110
110
let desc = format ! ( "Source of the Rust file `{}`." , filename) ;
111
111
let page = layout:: Page {
112
112
title : & title,
You can’t perform that action at this time.
0 commit comments