Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0d71181

Browse files
committedJan 10, 2025·
try fix
1 parent 3850e1e commit 0d71181

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎src/utils/cargo_metadata.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,12 @@ impl Package {
9090
}
9191

9292
pub(crate) fn package_name(&self) -> String {
93-
self.library_name()
94-
.unwrap_or_else(|| self.normalize_package_name(&self.targets[0].name))
93+
self.library_name().unwrap_or_else(|| {
94+
self.targets
95+
.first()
96+
.map(|t| self.normalize_package_name(&t.name))
97+
.unwrap_or_default()
98+
})
9599
}
96100

97101
pub(crate) fn library_name(&self) -> Option<String> {

0 commit comments

Comments
 (0)
Please sign in to comment.