From c454ed8c3c33ec6ae87696f6fcd1974dbd33991d Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Fri, 26 Jul 2024 00:20:59 +0700 Subject: [PATCH] deps: Require itertools 0.13 Itertools API changed slightly and they deprecated `group_by`, so just require latest for now. Also, remove uses of `#[macro_use]` and `extern crate` with `itertools`. --- Cargo.toml | 2 +- plot/Cargo.toml | 2 +- plot/src/candlestick.rs | 2 +- plot/src/curve.rs | 2 +- plot/src/errorbar.rs | 2 +- plot/src/filledcurve.rs | 2 +- plot/src/lib.rs | 2 -- src/plot/gnuplot_backend/summary.rs | 2 +- src/plot/plotters_backend/summary.rs | 2 +- 9 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index cea0bc3d..8a3ec658 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ exclude = ["book/*"] anes = "0.1.4" once_cell = "1.14" criterion-plot = { path = "plot", version = "0.5.0" } -itertools = ">=0.10, <=0.12" +itertools = "0.13" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" ciborium = "0.2.0" diff --git a/plot/Cargo.toml b/plot/Cargo.toml index 58dd1b3e..ee82cfa9 100644 --- a/plot/Cargo.toml +++ b/plot/Cargo.toml @@ -13,7 +13,7 @@ license = "MIT OR Apache-2.0" [dependencies] cast = "0.3" -itertools = ">=0.10, <=0.12" +itertools = "0.13" [dev-dependencies] itertools-num = "0.1" diff --git a/plot/src/candlestick.rs b/plot/src/candlestick.rs index ff2c0be0..2d861476 100644 --- a/plot/src/candlestick.rs +++ b/plot/src/candlestick.rs @@ -140,7 +140,7 @@ where } = candlesticks; let data = Matrix::new( - izip!(x, box_min, whisker_min, whisker_high, box_high), + itertools::izip!(x, box_min, whisker_min, whisker_high, box_high), (x_factor, y_factor, y_factor, y_factor, y_factor), ); self.plots diff --git a/plot/src/curve.rs b/plot/src/curve.rs index 3c2b68ae..39fef4b9 100644 --- a/plot/src/curve.rs +++ b/plot/src/curve.rs @@ -262,7 +262,7 @@ where let (x_factor, y_factor) = crate::scale_factor(&self.axes, props.axes.unwrap_or(crate::Axes::BottomXLeftY)); - let data = Matrix::new(izip!(x, y), (x_factor, y_factor)); + let data = Matrix::new(itertools::izip!(x, y), (x_factor, y_factor)); self.plots.push(Plot::new(data, &props)); self } diff --git a/plot/src/errorbar.rs b/plot/src/errorbar.rs index e8c73a67..9a33f50e 100644 --- a/plot/src/errorbar.rs +++ b/plot/src/errorbar.rs @@ -259,7 +259,7 @@ where } => (x, y, y_low, y_high, y_factor), }; let data = Matrix::new( - izip!(x, y, length, height), + itertools::izip!(x, y, length, height), (x_factor, y_factor, e_factor, e_factor), ); self.plots.push(Plot::new( diff --git a/plot/src/filledcurve.rs b/plot/src/filledcurve.rs index bc54082e..dea74e1d 100644 --- a/plot/src/filledcurve.rs +++ b/plot/src/filledcurve.rs @@ -132,7 +132,7 @@ where let (x_factor, y_factor) = crate::scale_factor(&self.axes, props.axes.unwrap_or(crate::Axes::BottomXLeftY)); - let data = Matrix::new(izip!(x, y1, y2), (x_factor, y_factor, y_factor)); + let data = Matrix::new(itertools::izip!(x, y1, y2), (x_factor, y_factor, y_factor)); self.plots.push(Plot::new(data, &props)); self } diff --git a/plot/src/lib.rs b/plot/src/lib.rs index c4953c2f..a948defb 100644 --- a/plot/src/lib.rs +++ b/plot/src/lib.rs @@ -372,8 +372,6 @@ #![allow(clippy::many_single_char_names)] extern crate cast; -#[macro_use] -extern crate itertools; use std::borrow::Cow; use std::fmt; diff --git a/src/plot/gnuplot_backend/summary.rs b/src/plot/gnuplot_backend/summary.rs index 12eb6066..d1b0195b 100644 --- a/src/plot/gnuplot_backend/summary.rs +++ b/src/plot/gnuplot_backend/summary.rs @@ -83,7 +83,7 @@ pub fn line_comparison( // This assumes the curves are sorted. It also assumes that the benchmark IDs all have numeric // values or throughputs and that value is sensible (ie. not a mix of bytes and elements // or whatnot) - for (key, group) in &all_curves.iter().group_by(|&&&(id, _)| &id.function_id) { + for (key, group) in &all_curves.iter().chunk_by(|&&&(id, _)| &id.function_id) { let mut tuples: Vec<_> = group .map(|&&(id, ref sample)| { // Unwrap is fine here because it will only fail if the assumptions above are not true diff --git a/src/plot/plotters_backend/summary.rs b/src/plot/plotters_backend/summary.rs index 4a82577c..929cc843 100644 --- a/src/plot/plotters_backend/summary.rs +++ b/src/plot/plotters_backend/summary.rs @@ -131,7 +131,7 @@ fn line_comparison_series_data<'a>( // This assumes the curves are sorted. It also assumes that the benchmark IDs all have numeric // values or throughputs and that value is sensible (ie. not a mix of bytes and elements // or whatnot) - for (key, group) in &all_curves.iter().group_by(|&&&(id, _)| &id.function_id) { + for (key, group) in &all_curves.iter().chunk_by(|&&&(id, _)| &id.function_id) { let mut tuples: Vec<_> = group .map(|&&(id, ref sample)| { // Unwrap is fine here because it will only fail if the assumptions above are not true