Skip to content

Commit 3024f95

Browse files
Philippe-Choletphimuemue
authored andcommitted
Fix iris.rs
1 parent 1c12851 commit 3024f95

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/iris.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,15 @@ fn main() {
7777
let mut plot_symbols = "+ox".chars().cycle();
7878
let mut symbolmap = HashMap::new();
7979

80-
// using Itertools::group_by
81-
for (species, species_group) in &irises.iter().group_by(|iris| &iris.name) {
80+
// using Itertools::chunk_by
81+
for (species, species_chunk) in &irises.iter().chunk_by(|iris| &iris.name) {
8282
// assign a plot symbol
8383
symbolmap
8484
.entry(species)
8585
.or_insert_with(|| plot_symbols.next().unwrap());
8686
println!("{} (symbol={})", species, symbolmap[species]);
8787

88-
for iris in species_group {
88+
for iris in species_chunk {
8989
// using Itertools::format for lazy formatting
9090
println!("{:>3.1}", iris.data.iter().format(", "));
9191
}

0 commit comments

Comments
 (0)