From c65677ce742e0aa06664359571260e76e5827855 Mon Sep 17 00:00:00 2001 From: Martin Ockajak Date: Thu, 11 Jul 2024 00:43:23 +0200 Subject: [PATCH] . --- src/extensions/collectible.rs | 19 ++++++++++++------- src/extensions/traversable.rs | 1 - 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/extensions/collectible.rs b/src/extensions/collectible.rs index b7aa609..44830ad 100644 --- a/src/extensions/collectible.rs +++ b/src/extensions/collectible.rs @@ -59,7 +59,7 @@ pub trait Collectible: IntoIterator { /// Creates a collection from the original collection without /// the first occurrence of an element. /// - /// The order or retained values is preserved for ordered collections. + /// The order of retained values is preserved for ordered collections. /// /// # Example /// @@ -96,7 +96,7 @@ pub trait Collectible: IntoIterator { /// Creates a collection from the original collection without /// the first occurrences of elements found in another collection. /// - /// The order or retained values is preserved for ordered collections. + /// The order of retained values is preserved for ordered collections. /// /// # Example /// @@ -139,11 +139,12 @@ pub trait Collectible: IntoIterator { /// Creates a collection containing combinations of specified size from the elements /// of the original collection. /// - /// The order or combined values is preserved for ordered collections. /// Combinations for ordered collections are generated based on element positions, not values. /// /// To obtain combinations of unique elements for ordered collections, use `.unique().combinations()`. /// + /// The order of combined values is preserved for ordered collections. + /// /// # Example /// /// ``` @@ -779,7 +780,7 @@ pub trait Collectible: IntoIterator { /// of the original collection with another collection i.e., the values that are /// both in `self` and `other`. /// - /// The order or retained values is preserved for ordered collections. + /// The order of retained values is preserved for ordered collections. /// /// # Example /// @@ -1022,7 +1023,11 @@ pub trait Collectible: IntoIterator { /// Creates a collection containing all subsets of the original collection. /// - /// The order or subset values is preserved for ordered collections. + /// Sub-collections for ordered collections are generated based on element positions, not values. + /// + /// To obtain combinations of unique elements for ordered collections, use `.unique().powerset()`. + /// + /// The order of combined values is preserved for ordered collections. /// /// # Example /// @@ -1128,7 +1133,7 @@ pub trait Collectible: IntoIterator { /// Creates a collection from the original collection by replacing the /// first occurrence of an element with a replacement value. /// - /// The order or retained values is preserved for ordered collections. + /// The order of retained values is preserved for ordered collections. /// /// # Example /// @@ -1160,7 +1165,7 @@ pub trait Collectible: IntoIterator { /// given occurrences of elements found in another collection with elements /// of a replacement collection. /// - /// The order or retained values is preserved for ordered collections. + /// The order of retained values is preserved for ordered collections. /// /// # Example /// diff --git a/src/extensions/traversable.rs b/src/extensions/traversable.rs index d252068..77be36e 100644 --- a/src/extensions/traversable.rs +++ b/src/extensions/traversable.rs @@ -468,7 +468,6 @@ pub trait Traversable { /// The reducing function is a closure with two arguments: an 'accumulator', and an element. /// For collections with at least one element, this is the same as [`fold()`] /// with the first element of the collection as the initial accumulator value, folding - /// every subsequent element into it. /// /// This is a non-consuming variant of [`reduce_to`]. ///