Skip to content

Commit 204dfee

Browse files
author
Tom Fay
authored
Extract root field (#5)
* Extract root field
1 parent 097fff0 commit 204dfee

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

rustaudit.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ type Package struct {
3131
Source string `json:"source"`
3232
Kind DependencyKind `json:"kind"`
3333
Dependencies []uint `json:"dependencies"`
34-
Features []string `json:"features"`
34+
Features []string `json:"features"` // Removed in cargo-auditable 0.5.0
35+
Root bool `json:"root"`
3536
}
3637

3738
// Default the Kind to Runtime during unmarshalling

rustaudit_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ func TestLinuxRustDependencies(t *testing.T) {
1919
log.Fatal(err)
2020
}
2121
assert.Equal(t, 2, len(versionInfo.Packages))
22-
assert.Equal(t, Package{Name: "crate_with_features", Version: "0.1.0", Source: "local", Kind: "runtime", Features: []string{"default", "library_crate"}, Dependencies: []uint{1}}, versionInfo.Packages[0])
22+
assert.Equal(t, Package{Name: "crate_with_features", Version: "0.1.0", Source: "local", Kind: "runtime", Dependencies: []uint{1}, Root: true}, versionInfo.Packages[0])
23+
assert.Equal(t, false, versionInfo.Packages[1].Root)
2324
}

0 commit comments

Comments
 (0)