diff --git a/Sources/Algorithms/Combinations.swift b/Sources/Algorithms/Combinations.swift index b35fb1d..2416863 100644 --- a/Sources/Algorithms/Combinations.swift +++ b/Sources/Algorithms/Combinations.swift @@ -138,7 +138,7 @@ extension Collection { /// four colors: /// /// let colors = ["fuchsia", "cyan", "mauve", "magenta"] - /// for combo in colors.combinations(ofCount k: 3) { + /// for combo in colors.combinations(ofCount: 3) { /// print(combo.joined(separator: ", ")) /// } /// // fuchsia, cyan, mauve diff --git a/Sources/Algorithms/Rotate.swift b/Sources/Algorithms/Rotate.swift index 6e80194..5b1fcfe 100644 --- a/Sources/Algorithms/Rotate.swift +++ b/Sources/Algorithms/Rotate.swift @@ -213,7 +213,7 @@ extension MutableCollection { /// rotating. /// - Returns: The new index of the element that was first pre-rotation. /// - /// - Complexity: O(*n*) + /// - Complexity: O(*n*), where *n* is the length of the collection. @inlinable @discardableResult public mutating func rotate(toStartAt newStart: Index) -> Index { @@ -273,7 +273,7 @@ extension MutableCollection where Self: BidirectionalCollection { /// rotating. /// - Returns: The new index of the element that was first pre-rotation. /// - /// - Complexity: O(*n*) + /// - Complexity: O(*n*), where *n* is the length of the collection. @inlinable @discardableResult public mutating func rotate(toStartAt newStart: Index) -> Index { diff --git a/Sources/Algorithms/Trim.swift b/Sources/Algorithms/Trim.swift index eb16d5d..3491426 100644 --- a/Sources/Algorithms/Trim.swift +++ b/Sources/Algorithms/Trim.swift @@ -11,22 +11,20 @@ extension BidirectionalCollection { - /// Returns a `SubSequence` formed by discarding all elements at the start and end of the collection - /// which satisfy the given predicate. + /// Returns a `SubSequence` formed by discarding all elements at the start and + /// end of the collection which satisfy the given predicate. /// - /// This example uses `trimming(where:)` to get a substring without the white space at the - /// beginning and end of the string: + /// This example uses `trimming(where:)` to get a substring without the white + /// space at the beginning and end of the string: /// - /// ``` - /// let myString = " hello, world " - /// print(myString.trimming(where: \.isWhitespace)) // "hello, world" - /// ``` + /// let myString = " hello, world " + /// print(myString.trimming(where: \.isWhitespace)) // "hello, world" /// - /// - parameters: - /// - predicate: A closure which determines if the element should be omitted from the - /// resulting slice. + /// - Parameters: + /// - predicate: A closure which determines if the element should be + /// omitted from the resulting slice. /// - /// - complexity: `O(n)`, where `n` is the length of this collection. + /// - Complexity: O(*n*), where *n* is the length of this collection. /// @inlinable public func trimming(