@@ -99,8 +99,11 @@ pub mod structs {
9999 pub use crate :: exactly_one_err:: ExactlyOneError ;
100100 pub use crate :: flatten_ok:: FlattenOk ;
101101 pub use crate :: format:: { Format , FormatWith } ;
102+ #[ allow( deprecated) ]
103+ #[ cfg( feature = "use_alloc" ) ]
104+ pub use crate :: groupbylazy:: GroupBy ;
102105 #[ cfg( feature = "use_alloc" ) ]
103- pub use crate :: groupbylazy:: { Chunk , Chunks , Group , GroupBy , Groups , IntoChunks } ;
106+ pub use crate :: groupbylazy:: { Chunk , ChunkBy , Chunks , Group , Groups , IntoChunks } ;
104107 #[ cfg( feature = "use_std" ) ]
105108 pub use crate :: grouping_map:: { GroupingMap , GroupingMapBy } ;
106109 pub use crate :: intersperse:: { Intersperse , IntersperseWith } ;
@@ -575,10 +578,10 @@ pub trait Itertools: Iterator {
575578 /// Consecutive elements that map to the same key (“runs”), are assigned
576579 /// to the same group.
577580 ///
578- /// `GroupBy ` is the storage for the lazy grouping operation.
581+ /// `ChunkBy ` is the storage for the lazy grouping operation.
579582 ///
580583 /// If the groups are consumed in order, or if each group's iterator is
581- /// dropped without keeping it around, then `GroupBy ` uses no
584+ /// dropped without keeping it around, then `ChunkBy ` uses no
582585 /// allocations. It needs allocations only if several group iterators
583586 /// are alive at the same time.
584587 ///
@@ -597,7 +600,7 @@ pub trait Itertools: Iterator {
597600 /// let data = vec![1, 3, -2, -2, 1, 0, 1, 2];
598601 /// // groups: |---->|------>|--------->|
599602 ///
600- /// // Note: The `&` is significant here, `GroupBy ` is iterable
603+ /// // Note: The `&` is significant here, `ChunkBy ` is iterable
601604 /// // only by reference. You can also call `.into_iter()` explicitly.
602605 /// let mut data_grouped = Vec::new();
603606 /// for (key, group) in &data.into_iter().chunk_by(|elt| *elt >= 0) {
@@ -606,7 +609,7 @@ pub trait Itertools: Iterator {
606609 /// assert_eq!(data_grouped, vec![(true, vec![1, 3]), (false, vec![-2, -2]), (true, vec![1, 0, 1, 2])]);
607610 /// ```
608611 #[ cfg( feature = "use_alloc" ) ]
609- fn chunk_by < K , F > ( self , key : F ) -> GroupBy < K , Self , F >
612+ fn chunk_by < K , F > ( self , key : F ) -> ChunkBy < K , Self , F >
610613 where
611614 Self : Sized ,
612615 F : FnMut ( & Self :: Item ) -> K ,
@@ -618,7 +621,7 @@ pub trait Itertools: Iterator {
618621 /// See [`.chunk_by()`](Itertools::chunk_by).
619622 #[ deprecated( note = "Use .chunk_by() instead" , since = "0.13.0" ) ]
620623 #[ cfg( feature = "use_alloc" ) ]
621- fn group_by < K , F > ( self , key : F ) -> GroupBy < K , Self , F >
624+ fn group_by < K , F > ( self , key : F ) -> ChunkBy < K , Self , F >
622625 where
623626 Self : Sized ,
624627 F : FnMut ( & Self :: Item ) -> K ,
@@ -633,7 +636,7 @@ pub trait Itertools: Iterator {
633636 /// determined by `size`. The last chunk will be shorter if there aren't
634637 /// enough elements.
635638 ///
636- /// `IntoChunks` is based on `GroupBy `: it is iterable (implements
639+ /// `IntoChunks` is based on `ChunkBy `: it is iterable (implements
637640 /// `IntoIterator`, **not** `Iterator`), and it only buffers if several
638641 /// chunk iterators are alive at the same time.
639642 ///
0 commit comments