Skip to content

Commit

Permalink
Fix rustdoc JSON lookup for crates with dashes. (obi1kenobi#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
obi1kenobi authored and tonowak committed Nov 10, 2022
1 parent f821a66 commit 5e7cf54
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/dump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ impl RustDocCommand {
.unwrap_or(pkg_spec)
.to_owned();

let json_path = target_dir.join(format!("doc/{}.json", crate_name));
// N.B.: Crates named like `foo-bar` have rustdoc JSON named like `foo_bar.json`.
let crate_name_with_underscores = crate_name.replace('-', "_");
let json_path = target_dir.join(format!("doc/{}.json", crate_name_with_underscores));
if json_path.exists() {
Ok(json_path)
} else {
Expand Down

0 comments on commit 5e7cf54

Please sign in to comment.