Isn’t it handy to have something like this?
impl<A: PartialOrd> Range {
fn contains(&self, x: &A) -> bool {
(*self.start <= *x) && (*x < *self.end)
}
}
I also thought about a new operator overload if 10 <= 1..100 { ... } (mimicking ‘∈’) but it might not be a good idea.