Skip to content

Commit 781a276

Browse files
jshasyphar
authored andcommitted
If static.files directory is present, use that.
1 parent b43460d commit 781a276

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/docbuilder/rustwide_builder.rs

+17-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,23 @@ impl RustwideBuilder {
227227
.tempdir()?;
228228
copy_dir_all(source, &dest)?;
229229

230-
add_path_into_database(&self.storage, RUSTDOC_STATIC_STORAGE_PREFIX, &dest)?;
230+
// One https://github.com/rust-lang/rust/pull/101702 lands, static files will be
231+
// put in their own directory, "static.files". To make sure those files are
232+
// available at --static-root-path, we add files from that subdirectory, if present.
233+
let static_files = dest.as_ref().join("static.files");
234+
if static_files.try_exists()? {
235+
add_path_into_database(
236+
&self.storage,
237+
RUSTDOC_STATIC_STORAGE_PREFIX,
238+
&static_files,
239+
)?;
240+
} else {
241+
add_path_into_database(
242+
&self.storage,
243+
RUSTDOC_STATIC_STORAGE_PREFIX,
244+
&dest,
245+
)?;
246+
}
231247

232248
set_config(
233249
&mut conn,

0 commit comments

Comments
 (0)