Skip to content

Commit

Permalink
deps: Require itertools 0.13
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
waywardmonkeys committed Jul 25, 2024
1 parent 1a18e88 commit c454ed8
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion plot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion plot/src/candlestick.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion plot/src/curve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion plot/src/errorbar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion plot/src/filledcurve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 0 additions & 2 deletions plot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/plot/gnuplot_backend/summary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/plot/plotters_backend/summary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c454ed8

Please sign in to comment.