refactor: Replace the bisection dependency#18
refactor: Replace the bisection dependency#18musicinmybrain wants to merge 1 commit intoprefix-dev:mainfrom
Conversation
It appears unmaintained, and we can use partition_point instead: https://doc.rust-lang.org/std/vec/struct.Vec.html#method.partition_point
|
Awesome! The less dependencies the better. What do you think is missing with regard to test coverage? Maybe you could add that? |
I’m just not really confident that the coverage of various stages of the For example, if I incorrectly write This is the kind of situation where some people would reach for property-based testing, like Python’s hypothesis, but there doesn’t seem to be an actively-maintained crate for that in the Rust ecosystem at the moment. |
|
https://crates.io/crates/proptest seems pretty well maintained |
The
bisectioncrate appears unmaintained (last commit four years ago), and has a couple of unaddressed issues. Since Rust 1.52, we can rely on the standard library and usepartition_pointinstead.Comparing the definition of
partition_pointwith the definitions ofbisect_leftandbisect_right, I believe this replacement should be exactly equivalent. However, I don’t believe the test coverage is sufficient to catch any subtle errors here, so I recommend closely double-checking my work.