As of Rust 1.35, the original code will almost1 compile as-is using Range::contains
:
fn main() {
let a = 3..5;
assert!(a.contains(&4));
}
1 Passing &4
instead of 4
to contains()
.
As of Rust 1.35, the original code will almost1 compile as-is using Range::contains
:
fn main() {
let a = 3..5;
assert!(a.contains(&4));
}
1 Passing &4
instead of 4
to contains()
.