From 8ad7d693788a36a95d95f76c56d8ff6a3d910d52 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Wed, 14 Aug 2024 12:37:02 -0400 Subject: [PATCH] indexed_docs: Normalize `-` in crate names to `_` when computing rustdoc output path (#16234) This PR fixes an issue where crate names that included `-`s would not work properly when indexing them with rustdoc, due to the output directories using `_` instead of `-`. Release Notes: - N/A --- crates/indexed_docs/src/providers/rustdoc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/indexed_docs/src/providers/rustdoc.rs b/crates/indexed_docs/src/providers/rustdoc.rs index 691d39fc0a..02192855dd 100644 --- a/crates/indexed_docs/src/providers/rustdoc.rs +++ b/crates/indexed_docs/src/providers/rustdoc.rs @@ -91,7 +91,7 @@ impl IndexedDocsProvider for LocalRustdocProvider { let item = item.cloned(); async move { let target_doc_path = cargo_workspace_root.join("target/doc"); - let mut local_cargo_doc_path = target_doc_path.join(crate_name.as_ref()); + let mut local_cargo_doc_path = target_doc_path.join(crate_name.as_ref().replace('-', "_")); if !fs.is_dir(&local_cargo_doc_path).await { let cargo_doc_exists_at_all = fs.is_dir(&target_doc_path).await;