method RangeInclusive.contains
lo <= x && x <= hi for any ordered T (D-3563); the same as x in lo..=hi.
Example:
fn main() io {
print("{(1..=5).contains(&5)} {(1..=5).contains(&6)}")
}Output
true false
pub(api) fn contains(x: &T) -> bool where T: OrdComplexity. O(1).
Since. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
x | &T |
Returns
bool where T: Ord
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/iter.oxl:995