From dfc55d891e0701b4d2a3dcc4bcf25cc929df6448 Mon Sep 17 00:00:00 2001 From: Daniel Henry-Mantilla Date: Wed, 23 Oct 2019 15:37:20 +0200 Subject: [PATCH 1/2] 0.8.1 Updated Changelog and Cargo.toml for the next release --- Cargo.toml | 2 +- README.rst | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 5790610c3..1fc2da78e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "itertools" -version = "0.8.0" +version = "0.8.1" license = "MIT/Apache-2.0" repository = "https://github.com/bluss/rust-itertools" diff --git a/README.rst b/README.rst index 45f1b5a27..2dac0cf7f 100644 --- a/README.rst +++ b/README.rst @@ -48,6 +48,98 @@ then it can't be accepted into ``libcore``, and you should propose it for ``iter Recent Changes -------------- +- 0.8.1 + + - Added a `.exactly_one() `_ + iterator method that, on success, extracts the single value of an + iterator + ; by `@Xaeroxe `_ + + - Added combinatory iterator adaptors: + + - `.permutations(k) `_: + + ``[0, 1, 2].iter().permutations(2)`` yields + + .. code:: rust + + [ + vec![0, 1], + vec![0, 2], + vec![1, 0], + vec![1, 2], + vec![2, 0], + vec![2, 1], + ] + + ; by `@tobz1000 `_ + + - `.combinations(k) `_: + + ``[0, 1, 2].iter().combinations(2)`` yields + + .. code:: rust + + [ + vec![0, 1], + vec![0, 2], + vec![1, 2], + ] + + ; by `@tobz1000 `_ + + - `.combinations_with_replacement(k) `_: + + ``[0, 1, 2].iter().combinations_with_replacement(2)`` yields + + .. code:: rust + + [ + vec![0, 0], + vec![0, 1], + vec![0, 2], + vec![1, 1], + vec![1, 2], + vec![2, 2], + ] + + ; by `@tommilligan `_ + + - Improved the performance of `.fold() `_-based internal iteration for the + `.intersperse() `_ iterator + ; by `@jswrenn `_ + + - Added + `.dedup_by() `_, + `.merge_by() `_ + and `.kmerge_by() `_ + adaptors that work like + `.dedup() `_, + `.merge() `_ and + `.kmerge() `_, + but taking an additional custom comparison closure parameter. + ; by `@phimuemue `_ + + - Improved the performance of `.all_equal() `_ + ; by `@fyrchik `_ + + - Loosened the bounds on `.partition_map() `_ + to take just a ``FnMut`` closure rather than a ``Fn`` closure, and made its + implementation use internal iteration for better performance + ; by `@danielhenrymantilla `_ + + - Added convenience methods to + `EitherOrBoth `_ elements yielded from the + `.zip_longest() `_ iterator adaptor + ; by `@Avi-D-coder `_ + + - Added `.sum1() `_ + and `.product1() `_ + iterator methods that respectively try to return the sum and the product of + the elements of an iterator **when it is not empty**, otherwise they return + ``None`` + ; by `@Emerentius `_ + - 0.8.0 - Added new adaptor ``.map_into()`` for conversions using ``Into`` by @vorner From a7a1203960451fe2ba21394e5b38981ef8323181 Mon Sep 17 00:00:00 2001 From: Daniel Henry-Mantilla Date: Thu, 24 Oct 2019 12:32:05 +0200 Subject: [PATCH 2/2] Removed `.combinations()` being featured as new ... but it has been kept to offer a place where all three combinatory methods can be quickly compared to each other --- README.rst | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/README.rst b/README.rst index 2dac0cf7f..1792c7589 100644 --- a/README.rst +++ b/README.rst @@ -74,37 +74,36 @@ Recent Changes ; by `@tobz1000 `_ - - `.combinations(k) `_: + - `.combinations_with_replacement(k) `_: - ``[0, 1, 2].iter().combinations(2)`` yields + ``[0, 1, 2].iter().combinations_with_replacement(2)`` yields .. code:: rust [ + vec![0, 0], vec![0, 1], vec![0, 2], + vec![1, 1], vec![1, 2], + vec![2, 2], ] - ; by `@tobz1000 `_ + ; by `@tommilligan `_ - - `.combinations_with_replacement(k) `_: + - For reference, these methods join the already existing + `.combinations(k) `_: - ``[0, 1, 2].iter().combinations_with_replacement(2)`` yields + ``[0, 1, 2].iter().combinations(2)`` yields .. code:: rust [ - vec![0, 0], vec![0, 1], vec![0, 2], - vec![1, 1], vec![1, 2], - vec![2, 2], ] - ; by `@tommilligan `_ - - Improved the performance of `.fold() `_-based internal iteration for the `.intersperse() `_ iterator ; by `@jswrenn `_