Skip to content

Commit 0fb8dee

Browse files
committed
all rustdoc tests appear to pass after changes
1 parent 495c9e5 commit 0fb8dee

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/librustdoc/html/render/write_shared.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ pub(crate) fn write_shared(
7575

7676
let external_crates = hack_get_external_crate_names(cx)?;
7777

78-
let sources = PartsAndLocations::<SourcesPart>::get(cx)?;
78+
let sources = PartsAndLocations::<SourcesPart>::get(cx, &crate_name_json)?;
7979
let SerializedSearchIndex { index, desc } = build_index(&krate, &mut Rc::get_mut(&mut cx.shared).unwrap().cache, tcx);
8080
let search_index = PartsAndLocations::<SearchIndexPart>::get(cx, index)?;
8181
let all_crates = PartsAndLocations::<AllCratesPart>::get(crate_name_json.clone())?;
@@ -372,7 +372,7 @@ createSrcSidebar();")
372372
}
373373
}
374374
impl PartsAndLocations<SourcesPart> {
375-
fn get(cx: &Context<'_>) -> Result<Self, Error> {
375+
fn get(cx: &Context<'_>, crate_name: &SortedJson) -> Result<Self, Error> {
376376
let hierarchy = Rc::new(Hierarchy::default());
377377
cx
378378
.shared
@@ -381,7 +381,9 @@ impl PartsAndLocations<SourcesPart> {
381381
.filter_map(|p| p.0.strip_prefix(&cx.shared.src_root).ok())
382382
.for_each(|source| hierarchy.add_path(source));
383383
let path = suffix_path("src-files.js", &cx.shared.resource_suffix);
384-
Ok(Self::with(path, hierarchy.to_json_string()))
384+
let hierarchy = hierarchy.to_json_string();
385+
let part = SortedJson::array_unsorted([crate_name, &hierarchy]);
386+
Ok(Self::with(path, part))
385387
}
386388
}
387389

@@ -463,7 +465,7 @@ impl NamedPart for TypeAliasPart {
463465
} else {
464466
window.pending_type_impls = type_impls;
465467
}
466-
})())")
468+
})()")
467469
}
468470
}
469471

@@ -580,7 +582,7 @@ impl NamedPart for TraitAliasPart {
580582
} else {
581583
window.pending_implementors = implementors;
582584
}
583-
})())")
585+
})()")
584586
}
585587
}
586588
impl PartsAndLocations<TraitAliasPart> {
@@ -872,7 +874,6 @@ fn write_rendered_cci<T: NamedPart + DeserializeOwned + fmt::Display + fmt::Debu
872874
}
873875
// write the merged cci to disk
874876
for (path, template) in templates {
875-
dbg!(&path, &template, &cx.dst);
876877
create_parents(cx, &path)?;
877878
let file = try_err!(File::create(&path), &path);
878879
let mut file = BufWriter::new(file);

0 commit comments

Comments
 (0)