enum Found { Empty, Before(T), After(T), Between(T, T), }
... and a range parameter instead of L and R.
And, TBH, this should probably just panic! on an invalid predicate rather than returning an error. Programming errors should panic.
enum Found { Empty, Before(T), After(T), Between(T, T), }
... and a range parameter instead of L and R.
And, TBH, this should probably just panic! on an invalid predicate rather than returning an error. Programming errors should panic.