Skip to content

Commit

Permalink
fix: some clippy lints causing CI to fail (#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
repnop authored Jan 8, 2025
1 parent 4ed5b2e commit f028633
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/types/constraints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -734,15 +734,15 @@ impl Bounded<i128> {
pub fn in_bound<I: IntegerType>(&self, element: &I) -> bool {
match &self {
Self::Range { start, end } => {
start.as_ref().map_or(true, |&start| {
start.as_ref().is_none_or(|&start| {
if let Some(e) = element.to_i128() {
e >= start
} else if let Some(e) = element.to_bigint() {
e >= BigInt::from(start)
} else {
false
}
}) && end.as_ref().map_or(true, |&end| {
}) && end.as_ref().is_none_or(|&end| {
if let Some(e) = element.to_i128() {
e <= end
} else if let Some(e) = element.to_bigint() {
Expand Down Expand Up @@ -792,8 +792,8 @@ impl<T: PartialEq + PartialOrd> Bounded<T> {
match &self {
Self::Single(value) => value == element,
Self::Range { start, end } => {
start.as_ref().map_or(true, |start| element >= start)
&& end.as_ref().map_or(true, |end| element <= end)
start.as_ref().is_none_or(|start| element >= start)
&& end.as_ref().is_none_or(|end| element <= end)
}
Self::None => true,
}
Expand Down

0 comments on commit f028633

Please sign in to comment.