Closed pranavpadmasali closed 1 year ago
I'm new to the Rust world. After reading a solution on StackOverflow that suggested using cargo run --release
, the error seems to have been resolved. Now, I'm not sure if the above issue is still relevant or not.
@pranavpadmasali - we should avoid panic even in debug mode. Let me take a look and see what needs to be fixed.
Thanks for the report!
This is fixed by #73 - and is published to crates.io as version 0.7.1
Thanks again for the detailed report and the reproducer for this issue!
When the ratelimiter is used with Rayon parallel iterator the execution panics with an error
thread '<unnamed>' panicked at 'attempt to subtract with overflow', /Users/pranavpadmasali/.cargo/registry/src/github.com-1ecc6299db9ec823/ratelimit-0.7.0/src/lib.rs:266:23
Expected behavior
The Rayon thread and program should not panic for subtract with overflow and continue execution.
Actual behavior
The subtract overflow seems to occurs at this statement. The thread panics with this error.
Steps to reproduce the behavior
Reproducer code
This is a minimal reproducer for the above error.
main.rs
cargo.toml dependencies
Executing with
bash RUST_BACKTRACE=full cargo run
The return code is