Skip to content

Commit d46a559

Browse files
usbalbinwxiaoguang
andauthored
Update modules/packages/cargo/parser.go
Co-authored-by: wxiaoguang <[email protected]>
1 parent b1904aa commit d46a559

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

modules/packages/cargo/parser.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,11 @@ func parsePackage(r io.Reader) (*Package, error) {
136136

137137
dependencies := make([]*Dependency, 0, len(meta.Deps))
138138
for _, dep := range meta.Deps {
139+
// https://doc.rust-lang.org/cargo/reference/registry-web-api.html#publish
140+
// It is a string of the new package name if the dependency is renamed, otherwise empty
139141
name := dep.ExplicitNameInToml
140142
pkg := &dep.Name
141-
if len(dep.ExplicitNameInToml) == 0 {
143+
if name == "" {
142144
name = dep.Name
143145
pkg = nil
144146
}

0 commit comments

Comments
 (0)