Skip to content

Commit ace1cc9

Browse files
authored
Fix warnings from clippy (rust 1.87.0) (#856)
1 parent 7afab6e commit ace1cc9

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

plot/src/axis.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ where
153153
}
154154
}
155155

156-
impl<'a> Script for (Axis, &'a Properties) {
156+
impl Script for (Axis, &Properties) {
157157
fn script(&self) -> String {
158158
let &(axis, properties) = self;
159159
let axis_ = axis.display();

plot/src/grid.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl Properties {
3131
}
3232
}
3333

34-
impl<'a> Script for (Axis, Grid, &'a Properties) {
34+
impl Script for (Axis, Grid, &Properties) {
3535
fn script(&self) -> String {
3636
let &(axis, grid, properties) = self;
3737
let axis = axis.display();

src/analysis/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ pub(crate) fn common<M: Measurement, T: ?Sized>(
111111

112112
criterion.report.analysis(id, report_context);
113113

114-
if times.iter().any(|&f| f == 0.0) {
114+
if times.contains(&0.0) {
115115
error!(
116116
"At least one measurement of benchmark {} took zero time per \
117117
iteration. This should not be possible. If using iter_custom, please verify \

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@ https://bheisler.github.io/criterion.rs/book/faq.html
939939
if matches.contains_id("baseline")
940940
|| matches
941941
.get_one::<String>("save-baseline")
942-
.map_or(false, |base| base != "base")
942+
.is_some_and(|base| base != "base")
943943
|| matches.contains_id("load-baseline")
944944
{
945945
eprintln!("Error: baselines are not supported when running with cargo-criterion.");

src/stats/univariate/outliers/tukey.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ where
153153
}
154154
}
155155

156-
impl<'a, 'b, A> IntoIterator for &'b LabeledSample<'a, A>
156+
impl<'a, A> IntoIterator for &LabeledSample<'a, A>
157157
where
158158
A: Float,
159159
{

src/stats/univariate/percentiles.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ where
2020
unsafe fn at_unchecked(&self, p: A) -> A {
2121
let _100 = A::cast(100);
2222
debug_assert!(p >= A::cast(0) && p <= _100);
23-
debug_assert!(self.0.len() > 0);
23+
debug_assert!(!self.0.is_empty());
2424
let len = self.0.len() - 1;
2525

2626
if p == _100 {
@@ -47,7 +47,7 @@ where
4747
let _100 = A::cast(100);
4848

4949
assert!(p >= _0 && p <= _100);
50-
assert!(self.0.len() > 0);
50+
assert!(!self.0.is_empty());
5151

5252
unsafe { self.at_unchecked(p) }
5353
}

0 commit comments

Comments
 (0)