Skip to content

Commit 243c8e9

Browse files
committed
Apply some review suggestions
1 parent 48060f1 commit 243c8e9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: src/librustdoc/html/sources.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::html::layout;
88
use crate::html::render::{SharedContext, BASIC_KEYWORDS};
99
use rustc_hir::def_id::LOCAL_CRATE;
1010
use rustc_span::source_map::FileName;
11-
use std::ffi::{OsStr, OsString};
11+
use std::ffi::OsStr;
1212
use std::fs;
1313
use 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,

0 commit comments

Comments
 (0)