Skip to content

Commit a844eb2

Browse files
authored
Bump MSRV to 1.60 for csv dependency (#665)
1 parent 2f53607 commit a844eb2

File tree

11 files changed

+34
-43
lines changed

11 files changed

+34
-43
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
matrix:
1919
rust:
2020
- stable
21-
- 1.59 # MSRV
21+
- 1.60.0 # MSRV
2222
- nightly
2323

2424
steps:

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2020

2121
- HTML report hidden behind non-default feature flag: 'html_reports'
2222
- Standalone support (ie without cargo-criterion) feature flag: 'cargo_bench_support'
23-
- MSRV bumped to 1.57
23+
- MSRV bumped to 1.60
2424
- `rayon` and `plotters` are optional (and default) dependencies.
2525
- Status messages ('warming up', 'analyzing', etc) are printed to stderr, benchmark results are printed to stdout.
2626
- Accept subsecond durations for `--warm-up-time`, `--measurement-time` and `--profile-time`.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ default-features = false
5151
features = ["svg_backend", "area_series", "line_series"]
5252

5353
[dev-dependencies]
54-
tempfile = "3.2.0"
54+
tempfile = "~3.2.0"
5555
approx = "0.5.0"
5656
quickcheck = { version = "1.0", default-features = false }
5757
rand = "0.8"

appveyor.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@ install:
2020

2121
build: false
2222

23+
# Disabled in favor of github actions
2324
test_script:
24-
- cargo build --release
25-
- cargo test --all --release
26-
- cargo build --benches --all --release
25+
# - cargo build --release
26+
# - cargo test --all --release
27+
# - cargo build --benches --all --release
2728
# Disable benchmarking until performance can be improved.
2829
# - cargo bench
29-
- cargo doc --release --all --no-deps
30+
# - cargo doc --release --all --no-deps
3031

3132
branches:
3233
only:

src/html/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,8 +537,8 @@ impl Report for Html {
537537
}
538538

539539
let mut groups = id_groups
540-
.into_iter()
541-
.map(|(_, group)| BenchmarkGroup::new(output_directory, &group))
540+
.into_values()
541+
.map(|group| BenchmarkGroup::new(output_directory, &group))
542542
.collect::<Vec<BenchmarkGroup<'_>>>();
543543
groups.sort_unstable_by_key(|g| g.group_report.name);
544544

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,9 @@ pub enum PlottingBackend {
287287
impl PlottingBackend {
288288
fn create_plotter(&self) -> Option<Box<dyn Plotter>> {
289289
match self {
290-
PlottingBackend::Gnuplot => Some(Box::new(Gnuplot::default())),
290+
PlottingBackend::Gnuplot => Some(Box::<Gnuplot>::default()),
291291
#[cfg(feature = "plotters")]
292-
PlottingBackend::Plotters => Some(Box::new(PlottersBackend::default())),
292+
PlottingBackend::Plotters => Some(Box::<PlottersBackend>::default()),
293293
#[cfg(not(feature = "plotters"))]
294294
PlottingBackend::Plotters => panic!("Criterion was built without plotters support."),
295295
PlottingBackend::None => None,
@@ -1432,7 +1432,7 @@ impl ActualSamplingMode {
14321432
}
14331433
}
14341434

1435-
(1..(n + 1) as u64).map(|a| a * d).collect::<Vec<u64>>()
1435+
(1..(n + 1)).map(|a| a * d).collect::<Vec<u64>>()
14361436
}
14371437
ActualSamplingMode::Flat => {
14381438
let n = sample_count;

src/plot/gnuplot_backend/summary.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ pub fn line_comparison(
6767

6868
let max = all_curves
6969
.iter()
70-
.map(|&&(_, ref data)| Sample::new(data).mean())
70+
.map(|&(_, data)| Sample::new(data).mean())
7171
.fold(::std::f64::NAN, f64::max);
7272

7373
let mut dummy = [1.0];
@@ -134,7 +134,7 @@ pub fn violin(
134134

135135
let kdes = all_curves
136136
.iter()
137-
.map(|&&(_, ref sample)| {
137+
.map(|&(_, sample)| {
138138
let (x, mut y) = kde::sweep(Sample::new(sample), KDE_POINTS, None);
139139
let y_max = Sample::new(&y).max();
140140
for y in y.iter_mut() {
@@ -144,10 +144,7 @@ pub fn violin(
144144
(x, y)
145145
})
146146
.collect::<Vec<_>>();
147-
let mut xs = kdes
148-
.iter()
149-
.flat_map(|&(ref x, _)| x.iter())
150-
.filter(|&&x| x > 0.);
147+
let mut xs = kdes.iter().flat_map(|(x, _)| x.iter()).filter(|&&x| x > 0.);
151148
let (mut min, mut max) = {
152149
let &first = xs.next().unwrap();
153150
(first, first)
@@ -174,7 +171,7 @@ pub fn violin(
174171
.configure(Axis::BottomX, |a| {
175172
a.configure(Grid::Major, |g| g.show())
176173
.configure(Grid::Minor, |g| g.hide())
177-
.set(Range::Limits(0., max as f64 * one[0]))
174+
.set(Range::Limits(0., max * one[0]))
178175
.set(Label(format!("Average time ({})", unit)))
179176
.set(axis_scale.to_gnuplot())
180177
})
@@ -190,7 +187,7 @@ pub fn violin(
190187
});
191188

192189
let mut is_first = true;
193-
for (i, &(ref x, ref y)) in kdes.iter().enumerate() {
190+
for (i, (x, y)) in kdes.iter().enumerate() {
194191
let i = i as f64 + 0.5;
195192
let y1: Vec<_> = y.iter().map(|&y| i + y * 0.45).collect();
196193
let y2: Vec<_> = y.iter().map(|&y| i - y * 0.45).collect();

src/plot/plotters_backend/pdf.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub(crate) fn pdf_comparison_figure(
3838
let y_range = data::fitting_range(base_ys.iter().chain(ys.iter()));
3939

4040
let size = size.unwrap_or(SIZE);
41-
let root_area = SVGBackend::new(&path, (size.0 as u32, size.1 as u32)).into_drawing_area();
41+
let root_area = SVGBackend::new(&path, (size.0, size.1)).into_drawing_area();
4242

4343
let mut cb = ChartBuilder::on(&root_area);
4444

@@ -132,7 +132,7 @@ pub(crate) fn pdf_small(
132132
let path = context.report_path(id, "pdf_small.svg");
133133

134134
let size = size.unwrap_or(SIZE);
135-
let root_area = SVGBackend::new(&path, (size.0 as u32, size.1 as u32)).into_drawing_area();
135+
let root_area = SVGBackend::new(&path, (size.0, size.1)).into_drawing_area();
136136

137137
let mut chart = ChartBuilder::on(&root_area)
138138
.margin((5).percent())
@@ -208,7 +208,7 @@ pub(crate) fn pdf(
208208
let xs_ = Sample::new(&xs);
209209

210210
let size = size.unwrap_or(SIZE);
211-
let root_area = SVGBackend::new(&path, (size.0 as u32, size.1 as u32)).into_drawing_area();
211+
let root_area = SVGBackend::new(&path, (size.0, size.1)).into_drawing_area();
212212

213213
let range = data::fitting_range(ys.iter());
214214

src/plot/plotters_backend/summary.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ fn line_comparison_series_data<'a>(
120120
) -> (&'static str, Vec<(Option<&'a String>, Vec<f64>, Vec<f64>)>) {
121121
let max = all_curves
122122
.iter()
123-
.map(|&&(_, ref data)| Sample::new(data).mean())
123+
.map(|&(_, data)| Sample::new(data).mean())
124124
.fold(::std::f64::NAN, f64::max);
125125

126126
let mut dummy = [1.0];
@@ -176,7 +176,7 @@ pub fn violin(
176176

177177
let mut xs = kdes
178178
.iter()
179-
.flat_map(|&(_, ref x, _)| x.iter())
179+
.flat_map(|(_, x, _)| x.iter())
180180
.filter(|&&x| x > 0.);
181181
let (mut min, mut max) = {
182182
let &first = xs.next().unwrap();

src/report.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ impl BenchmarkId {
116116
throughput: Option<Throughput>,
117117
) -> BenchmarkId {
118118
let full_id = match (&function_id, &value_str) {
119-
(&Some(ref func), &Some(ref val)) => format!("{}/{}/{}", group_id, func, val),
120-
(&Some(ref func), &None) => format!("{}/{}", group_id, func),
121-
(&None, &Some(ref val)) => format!("{}/{}", group_id, val),
119+
(Some(func), Some(val)) => format!("{}/{}/{}", group_id, func, val),
120+
(Some(func), &None) => format!("{}/{}", group_id, func),
121+
(&None, Some(val)) => format!("{}/{}", group_id, val),
122122
(&None, &None) => group_id.clone(),
123123
};
124124

@@ -129,18 +129,18 @@ impl BenchmarkId {
129129
}
130130

131131
let directory_name = match (&function_id, &value_str) {
132-
(&Some(ref func), &Some(ref val)) => format!(
132+
(Some(func), Some(val)) => format!(
133133
"{}/{}/{}",
134134
make_filename_safe(&group_id),
135135
make_filename_safe(func),
136136
make_filename_safe(val)
137137
),
138-
(&Some(ref func), &None) => format!(
138+
(Some(func), &None) => format!(
139139
"{}/{}",
140140
make_filename_safe(&group_id),
141141
make_filename_safe(func)
142142
),
143-
(&None, &Some(ref val)) => format!(
143+
(&None, Some(val)) => format!(
144144
"{}/{}",
145145
make_filename_safe(&group_id),
146146
make_filename_safe(val)

0 commit comments

Comments
 (0)