diff --git a/src/set.rs b/src/set.rs index bd98af7d0..7760bfd3b 100644 --- a/src/set.rs +++ b/src/set.rs @@ -1044,7 +1044,7 @@ where /// assert_eq!(a.is_disjoint(&b), false); /// ``` pub fn is_disjoint(&self, other: &Self) -> bool { - self.iter().all(|v| !other.contains(v)) + self.intersection(other).next().is_none() } /// Returns `true` if the set is a subset of another,