mainmatter / cargo-autoinherit

(Auto)DRY for your Rust dependencies
Apache License 2.0
130 stars 8 forks source link

Cases where 0 comparators are encountered will cause an index out of bound panic #3

Closed ncatelli closed 7 months ago

ncatelli commented 7 months ago

At line 126, I believe the sign was reversed. https://github.com/mainmatter/cargo-autoinherit/blob/main/src/dedup.rs#L126-L129

$ cargo autoinherit
thread 'main' paniced at src/dedup.rs:129:32:
index out of bounds: the len is 0 but the index is 0
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
k0nserv commented 7 months ago

This happens due to wildcard version requirements, I fixed it in #4

LukeMathWalker commented 7 months ago

Fixed by #4 and https://github.com/mainmatter/cargo-autoinherit/commit/35325140f0bb15dc1fbff29bf262bfe477b59625. Thank you both 🙏🏻