Skip to content

Commit 7e6be9d

Browse files
Use short neat && instead of if ... else
1 parent f2de794 commit 7e6be9d

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)