We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 15bc9b6 commit 6751769Copy full SHA for 6751769
library/core/src/slice/mod.rs
@@ -1412,6 +1412,7 @@ impl<T> [T] {
1412
/// # Examples
1413
///
1414
/// ```
1415
+ /// # #![feature(contains_ref)]
1416
/// let v = [String::from("Hello"), String::from("world")];
1417
/// assert!(v.contains_ref("Hello"));
1418
/// assert!(!v.contains_ref("Rust"));
@@ -1420,6 +1421,7 @@ impl<T> [T] {
1420
1421
pub fn contains_ref<U>(&self, x: &U) -> bool
1422
where
1423
T: PartialEq<U>,
1424
+ U: ?Sized,
1425
{
1426
self.iter().any(|e| e == x)
1427
}
0 commit comments