Skip to content

Commit 629fa19

Browse files
committed
Auto merge of #129 - CreepySkeleton:patch-1, r=Amanieu
Use short neat `&&` instead of `if ... else`
2 parents f2de794 + 7e6be9d commit 629fa19

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/set.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -700,11 +700,7 @@ where
700700
/// assert_eq!(set.is_subset(&sup), false);
701701
/// ```
702702
pub fn is_subset(&self, other: &Self) -> bool {
703-
if self.len() <= other.len() {
704-
self.iter().all(|v| other.contains(v))
705-
} else {
706-
false
707-
}
703+
self.len() <= other.len() && self.iter().all(|v| other.contains(v))
708704
}
709705

710706
/// Returns `true` if the set is a superset of another,

0 commit comments

Comments
 (0)