Skip to content

Commit 4fa7031

Browse files
committed
Restructure Range::in_bounds
1 parent 07cdc2c commit 4fa7031

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

types/range.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,10 @@ impl<S: BoundSided, T: Ord> RangeBound<S, T> {
153153
/// Determines if a value lies within the range specified by this bound.
154154
pub fn in_bounds(&self, value: &T) -> bool {
155155
match (self.type_, BoundSided::side(None::<S>)) {
156-
(Inclusive, Upper) if value <= &self.value => true,
157-
(Exclusive, Upper) if value < &self.value => true,
158-
(Inclusive, Lower) if value >= &self.value => true,
159-
(Exclusive, Lower) if value > &self.value => true,
160-
_ => false
156+
(Inclusive, Upper) => value <= &self.value,
157+
(Exclusive, Upper) => value < &self.value,
158+
(Inclusive, Lower) => value >= &self.value,
159+
(Exclusive, Lower) => value > &self.value,
161160
}
162161
}
163162
}

0 commit comments

Comments
 (0)