Skip to content

Commit

Permalink
Fix nits
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Feb 23, 2021
1 parent 1a7126b commit 41fc58b
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/librustdoc/html/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -515,11 +515,7 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
all: Rc::new(RefCell::new(AllTypes::new())),
errors: Rc::new(receiver),
cache: Rc::new(cache),
redirections: if generate_redirect_map {
Some(Rc::new(RefCell::new(FxHashMap::default())))
} else {
None
},
redirections: if generate_redirect_map { Some(Default::default()) } else { None },
};

CURRENT_DEPTH.with(|s| s.set(0));
Expand Down Expand Up @@ -683,9 +679,9 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
if !buf.is_empty() {
let name = item.name.as_ref().unwrap();
let item_type = item.type_();
let file_name = item_path(item_type, &name.as_str());
let file_name = &item_path(item_type, &name.as_str());
self.shared.ensure_dir(&self.dst)?;
let joint_dst = self.dst.join(&file_name);
let joint_dst = self.dst.join(file_name);
self.shared.fs.write(&joint_dst, buf.as_bytes())?;

if !self.render_redirect_pages {
Expand All @@ -702,7 +698,7 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
format!("{}/{}", crate_name, file_name),
);
} else {
let v = layout::redirect(&file_name);
let v = layout::redirect(file_name);
let redir_dst = self.dst.join(redir_name);
self.shared.fs.write(&redir_dst, v.as_bytes())?;
}
Expand Down

0 comments on commit 41fc58b

Please sign in to comment.