Skip to content

Commit

Permalink
fix(rust): pick question panic when there is no bin in Cargo.toml (#274)
Browse files Browse the repository at this point in the history
  • Loading branch information
j178 authored Jan 27, 2024
1 parent fd7a5b9 commit 34b9f1c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lang/rust.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,9 @@ func addBinSection(result *GenerateResult) error {
}

exists := false
if cargo["bin"] == nil {
cargo["bin"] = []any{}
}
bins := make([]map[string]any, len(cargo["bin"].([]any)))
for i, bin := range cargo["bin"].([]any) {
bins[i] = bin.(map[string]any)
Expand Down

0 comments on commit 34b9f1c

Please sign in to comment.