We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
[T]::contains
1 parent 716394d commit d53469cCopy full SHA for d53469c
library/core/src/slice/mod.rs
@@ -1948,8 +1948,9 @@ impl<T> [T] {
1948
/// assert!(!v.contains(&50));
1949
/// ```
1950
///
1951
- /// If you do not have an `&T`, but just an `&U` such that `T: Borrow<U>`
1952
- /// (e.g. `String: Borrow<str>`), you can use `iter().any`:
+ /// If you do not have a `&T`, but some other value that you can compare
+ /// with one (for example, `String` implements `PartialEq<str>`), you can
1953
+ /// use `iter().any`:
1954
1955
1956
/// let v = [String::from("hello"), String::from("world")]; // slice of `String`
0 commit comments