From e44b351372abd7bbeb7117f8ac534bcb0673225c Mon Sep 17 00:00:00 2001 From: Martin Ockajak Date: Thu, 11 Jul 2024 00:20:37 +0200 Subject: [PATCH] . --- src/extensions/sequence.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/extensions/sequence.rs b/src/extensions/sequence.rs index ddd4875..fea099f 100644 --- a/src/extensions/sequence.rs +++ b/src/extensions/sequence.rs @@ -276,7 +276,7 @@ pub trait Sequence { chunked(self, size, true) } - // FIXME - implement + // // FIXME - fix failing test case // /// Creates a collection by splitting the original collection into non-overlapping // /// subsequences according to specified separator predicate. // /// @@ -292,8 +292,7 @@ pub trait Sequence { // /// let a = vec![1, 2, -1, 1, 2]; // /// // /// let chunked = a.chunked_by(|&x| x >= 0); - // /// // FIXME - correct errors - // /// assert_eq!(chunked, vec![vec![1, 2], vec![-1], vec![1, 2]]) + // /// // assert_eq!(chunked, vec![vec![1, 2], vec![-1], vec![1, 2]]) // /// ``` // fn chunked_by(self, mut predicate: impl FnMut(&Item, &Item) -> bool) -> Self::This // where @@ -305,7 +304,7 @@ pub trait Sequence { // let mut index: usize = 0; // let mut iterator = self.into_iter(); // iterator.next().map(|first| { - // let mut prev = first; + // let prev = first; // for item in iterator { // if index > 0 && predicate(&prev, &item) { // chunk.extend(iter::once(prev)); @@ -1306,7 +1305,7 @@ pub trait Sequence { .collect() } - /// Creates a two collection by by splitting a collection of pairs. + /// Creates a two collection by splitting a collection of pairs. /// /// `unzip()` produces two collections: one from the left elements of the pairs, /// and one from the right elements.