Skip to content

Commit 28bb113

Browse files
committed
Replace dash with underscore in target name
Dash is not allowed in crate names and replaced with underscore. This is trying to fix #15.
1 parent 39e4108 commit 28bb113

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/db/add_package.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub fn add_package_into_database(conn: &Connection,
5454
&format!("{}", pkg.manifest().version()),
5555
&release_time,
5656
&dependencies.to_json(),
57-
&pkg.targets()[0].name(),
57+
&pkg.targets()[0].name().replace("-", "_"),
5858
&yanked,
5959
&res.build_success,
6060
&res.have_doc,

src/docbuilder/chroot_builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ impl DocBuilder {
277277
.join(&self.options.chroot_user)
278278
.join(canonical_name(&package))
279279
.join("doc")
280-
.join(package.targets()[0].name().to_string());
280+
.join(package.targets()[0].name().replace("-", "_").to_string());
281281
crate_doc_path.exists()
282282
}
283283

0 commit comments

Comments
 (0)