Closed mirandaconrado closed 2 weeks ago
Would love for this to be done!
Hey sorry for the delay.
This seems like a reasonable ask and I can't think of any counterarguments. If you're interested in putting up a PR, I'm in favor of accepting it. I'll drop a note to the other maintainers to make sure they're also onboard.
Thanks
Awesome. I'll look into the codebase on how to implement it and try to follow the existing patterns.
I have encountered scenarios in my code where I end up with empty ranges. Most of the time this happens when one of the bounds of the range comes from an arbitrary value. It's kind of hard to track these down because they fail at the moment that values are generated instead of failing when the strategy is created, even though we know by then that it will fail.
Example:
causes
which doesn't actually point to the example code anywhere (though it does refer to
example::empty_range
. It would be more useful to have a panic at the moment that we try to create a strategy for the empty range instead of when we sample from it.I'm happy to work on a PR for this assuming that the maintainers believe it should be done, and maybe have a recommendation.