Skip to content

Commit

Permalink
fix link generation when the crate name contains '-'
Browse files Browse the repository at this point in the history
  • Loading branch information
msrd0 committed Jun 7, 2021
1 parent 286041a commit 5698d97
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ fn resolve_dependencies(
// the last release. Also, the version in the current manifest might not be released, so
// those links might be dead.
deps.insert(
manifest.name().to_string(),
manifest.name().to_string().replace('-', "_"),
(manifest.name().to_string(), manifest.version().clone())
);

Expand All @@ -165,7 +165,7 @@ fn resolve_dependencies(
.unwrap_or(true)
{
deps.insert(
dep.name_in_toml().to_string().replace("-", "_"),
dep.name_in_toml().to_string().replace('-', "_"),
(sum.name().to_string(), sum.version().clone())
);
}
Expand All @@ -184,7 +184,7 @@ macro_rules! item_ident {
}

fn read_scope_from_file(manifest: &Manifest, file: &syn::File) -> anyhow::Result<Scope> {
let crate_name = manifest.name();
let crate_name = manifest.name().replace('-', "_");
let mut scope = Scope::prelude(manifest.edition());

for i in &file.items {
Expand Down

0 comments on commit 5698d97

Please sign in to comment.