Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace map_or with is_some_and.
Browse files Browse the repository at this point in the history
This change replaces more noisy Boolean calls to `map_or` with
`is_some_and`.
olson-sean-k committed Nov 22, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 576b003 commit 9c8f5f7
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/expression.rs
Original file line number Diff line number Diff line change
@@ -532,12 +532,11 @@ where
const NEG_INFINITY: Self = Defined(InfinityEncoding::NEG_INFINITY);

fn is_infinite(self) -> bool {
self.defined()
.map_or(false, |defined| defined.is_infinite())
self.defined().is_some_and(InfinityEncoding::is_infinite)

Check failure on line 535 in src/expression.rs

GitHub Actions / Test (ubuntu-latest, 1.65.0)

use of unstable library feature 'is_some_with'

Check failure on line 535 in src/expression.rs

GitHub Actions / Test (ubuntu-latest, 1.65.0)

the trait bound `&Constrained<T, C>: InfinityEncoding` is not satisfied

Check failure on line 535 in src/expression.rs

GitHub Actions / Test (ubuntu-latest, 1.65.0)

the trait bound `&Constrained<T, C>: InfinityEncoding` is not satisfied

Check failure on line 535 in src/expression.rs

GitHub Actions / Test (macOS-latest, 1.65.0)

use of unstable library feature 'is_some_with'

Check failure on line 535 in src/expression.rs

GitHub Actions / Test (macOS-latest, 1.65.0)

the trait bound `&Constrained<T, C>: InfinityEncoding` is not satisfied

Check failure on line 535 in src/expression.rs

GitHub Actions / Test (macOS-latest, 1.65.0)

the trait bound `&Constrained<T, C>: InfinityEncoding` is not satisfied

Check failure on line 535 in src/expression.rs

GitHub Actions / Test (windows-latest, 1.65.0)

use of unstable library feature 'is_some_with'

Check failure on line 535 in src/expression.rs

GitHub Actions / Test (windows-latest, 1.65.0)

the trait bound `&Constrained<T, C>: InfinityEncoding` is not satisfied

Check failure on line 535 in src/expression.rs

GitHub Actions / Test (windows-latest, 1.65.0)

the trait bound `&Constrained<T, C>: InfinityEncoding` is not satisfied
}

fn is_finite(self) -> bool {
self.defined().map_or(false, |defined| defined.is_finite())
self.defined().is_some_and(InfinityEncoding::is_finite)

Check failure on line 539 in src/expression.rs

GitHub Actions / Test (ubuntu-latest, 1.65.0)

use of unstable library feature 'is_some_with'

Check failure on line 539 in src/expression.rs

GitHub Actions / Test (ubuntu-latest, 1.65.0)

the trait bound `&Constrained<T, C>: InfinityEncoding` is not satisfied

Check failure on line 539 in src/expression.rs

GitHub Actions / Test (ubuntu-latest, 1.65.0)

the trait bound `&Constrained<T, C>: InfinityEncoding` is not satisfied

Check failure on line 539 in src/expression.rs

GitHub Actions / Test (macOS-latest, 1.65.0)

use of unstable library feature 'is_some_with'

Check failure on line 539 in src/expression.rs

GitHub Actions / Test (macOS-latest, 1.65.0)

the trait bound `&Constrained<T, C>: InfinityEncoding` is not satisfied

Check failure on line 539 in src/expression.rs

GitHub Actions / Test (macOS-latest, 1.65.0)

the trait bound `&Constrained<T, C>: InfinityEncoding` is not satisfied

Check failure on line 539 in src/expression.rs

GitHub Actions / Test (windows-latest, 1.65.0)

use of unstable library feature 'is_some_with'

Check failure on line 539 in src/expression.rs

GitHub Actions / Test (windows-latest, 1.65.0)

the trait bound `&Constrained<T, C>: InfinityEncoding` is not satisfied

Check failure on line 539 in src/expression.rs

GitHub Actions / Test (windows-latest, 1.65.0)

the trait bound `&Constrained<T, C>: InfinityEncoding` is not satisfied
}
}

@@ -587,7 +586,7 @@ where
self.as_ref()
.defined()
.zip(other.as_ref().defined())
.map_or(false, |(left, right)| left.eq(right))
.is_some_and(|(left, right)| left.eq(right))

Check failure on line 589 in src/expression.rs

GitHub Actions / Test (ubuntu-latest, 1.65.0)

use of unstable library feature 'is_some_with'

Check failure on line 589 in src/expression.rs

GitHub Actions / Test (macOS-latest, 1.65.0)

use of unstable library feature 'is_some_with'

Check failure on line 589 in src/expression.rs

GitHub Actions / Test (windows-latest, 1.65.0)

use of unstable library feature 'is_some_with'
}
}

@@ -647,11 +646,11 @@ where
const LOG10_E: Self = Defined(UnaryRealFunction::LOG10_E);

fn is_zero(self) -> bool {
self.defined().map_or(false, |defined| defined.is_zero())
self.defined().is_some_and(UnaryRealFunction::is_zero)

Check failure on line 649 in src/expression.rs

GitHub Actions / Test (ubuntu-latest, 1.65.0)

use of unstable library feature 'is_some_with'

Check failure on line 649 in src/expression.rs

GitHub Actions / Test (ubuntu-latest, 1.65.0)

the trait bound `&Constrained<T, C>: UnaryRealFunction` is not satisfied

Check failure on line 649 in src/expression.rs

GitHub Actions / Test (ubuntu-latest, 1.65.0)

the trait bound `&Constrained<T, C>: UnaryRealFunction` is not satisfied

Check failure on line 649 in src/expression.rs

GitHub Actions / Test (macOS-latest, 1.65.0)

use of unstable library feature 'is_some_with'

Check failure on line 649 in src/expression.rs

GitHub Actions / Test (macOS-latest, 1.65.0)

the trait bound `&Constrained<T, C>: UnaryRealFunction` is not satisfied

Check failure on line 649 in src/expression.rs

GitHub Actions / Test (macOS-latest, 1.65.0)

the trait bound `&Constrained<T, C>: UnaryRealFunction` is not satisfied

Check failure on line 649 in src/expression.rs

GitHub Actions / Test (windows-latest, 1.65.0)

use of unstable library feature 'is_some_with'

Check failure on line 649 in src/expression.rs

GitHub Actions / Test (windows-latest, 1.65.0)

the trait bound `&Constrained<T, C>: UnaryRealFunction` is not satisfied

Check failure on line 649 in src/expression.rs

GitHub Actions / Test (windows-latest, 1.65.0)

the trait bound `&Constrained<T, C>: UnaryRealFunction` is not satisfied
}

fn is_one(self) -> bool {
self.defined().map_or(false, |defined| defined.is_one())
self.defined().is_some_and(UnaryRealFunction::is_one)
}

fn sign(self) -> Sign {

0 comments on commit 9c8f5f7

Please sign in to comment.