Skip to content

Commit

Permalink
Fix nightly lints
Browse files Browse the repository at this point in the history
  • Loading branch information
HadrienG2 committed Nov 21, 2024
1 parent f4f0e60 commit 23feba5
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 11 deletions.
3 changes: 1 addition & 2 deletions src/bitmap/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2689,8 +2689,7 @@ pub(crate) mod tests {

fn infinite_intersects_finite(infinite: &RangeFrom<BitmapIndex>, finite: &Bitmap) -> bool {
finite
.last_set()
.map_or(false, |last_set| infinite.start <= last_set)
.last_set().is_some_and(|last_set| infinite.start <= last_set)
}
prop_assert_eq!(
bitmap.intersects(&other),
Expand Down
2 changes: 1 addition & 1 deletion src/ffi/int.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub(crate) fn expect_usize(x: c_uint) -> usize {
pub(crate) fn assert_slice_len<T>(len: usize) {
assert!(
len.checked_mul(std::mem::size_of::<T>())
.map_or(false, |prod| isize::try_from(prod).is_ok()),
.is_some_and(|prod| isize::try_from(prod).is_ok()),
"got an unsupported slice length from hwloc"
)
}
Expand Down
4 changes: 2 additions & 2 deletions src/object/depth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ impl PartialEq<Depth> for NormalDepth {
//
impl PartialEq<usize> for Depth {
fn eq(&self, other: &usize) -> bool {
Self::try_from(*other).map_or(false, |other| *self == other)
Self::try_from(*other) == Ok(*self)
}
}
//
Expand Down Expand Up @@ -411,7 +411,7 @@ mod tests {
fn eq_usize(depth: Depth, value: usize) {
prop_assert_eq!(
depth == value,
PositiveInt::try_from(value).map_or(false, |value| depth == value)
PositiveInt::try_from(value).is_ok_and(|value| depth == value)
);
}
}
Expand Down
6 changes: 1 addition & 5 deletions src/object/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,11 +440,7 @@ impl TopologyObject {
pub fn first_shared_cache(&self) -> Option<&Self> {
let cpuset = self.cpuset()?;
self.ancestors()
.skip_while(|ancestor| {
ancestor
.cpuset()
.map_or(false, |ancestor_set| ancestor_set == cpuset)
})
.skip_while(|ancestor| ancestor.cpuset() == Some(cpuset))
.find(|ancestor| ancestor.object_type().is_cpu_data_cache())
}

Expand Down
2 changes: 1 addition & 1 deletion src/topology/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ impl Topology {
get_group: fn(&FeatureSupport) -> Option<&Group>,
check_feature: fn(&Group) -> bool,
) -> bool {
get_group(self.feature_support()).map_or(false, check_feature)
get_group(self.feature_support()).is_some_and(check_feature)
}

/// Filtering that was applied for the given object type
Expand Down

0 comments on commit 23feba5

Please sign in to comment.