From efed24e4def67ccb78ff0f771b44acbf342adf07 Mon Sep 17 00:00:00 2001 From: Valeriy Van Date: Mon, 22 May 2023 13:23:53 +0300 Subject: [PATCH] Fix doc comment for trimPrefix and trimmingPrefix funcs --- .../Algorithms/Algorithms/Trim.swift | 32 +++++++------------ 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/Sources/_StringProcessing/Algorithms/Algorithms/Trim.swift b/Sources/_StringProcessing/Algorithms/Algorithms/Trim.swift index 2908c4dc5..e870e1493 100644 --- a/Sources/_StringProcessing/Algorithms/Algorithms/Trim.swift +++ b/Sources/_StringProcessing/Algorithms/Algorithms/Trim.swift @@ -81,13 +81,11 @@ extension RangeReplaceableCollection { // MARK: Fixed pattern algorithms extension Collection where Element: Equatable { - /// Returns a new collection of the same type by removing initial elements - /// that satisfy the given predicate from the start. - /// - Parameter predicate: A closure that takes an element of the sequence - /// as its argument and returns a Boolean value indicating whether the - /// element should be removed from the collection. + /// Returns a new collection of the same type by removing `prefix` from the start + /// of the collection. + /// - Parameter prefix: The collection to remove from this collection. /// - Returns: A collection containing the elements of the collection that are - /// not removed by `predicate`. + /// not removed by `prefix`. @available(SwiftStdlib 5.7, *) public func trimmingPrefix( _ prefix: Prefix @@ -97,11 +95,8 @@ extension Collection where Element: Equatable { } extension Collection where SubSequence == Self, Element: Equatable { - /// Removes the initial elements that satisfy the given predicate from the - /// start of the sequence. - /// - Parameter predicate: A closure that takes an element of the sequence - /// as its argument and returns a Boolean value indicating whether the - /// element should be removed from the collection. + /// Removes `prefix` from the start of the collection. + /// - Parameter prefix: The collection to remove from this collection. @available(SwiftStdlib 5.7, *) public mutating func trimPrefix( _ prefix: Prefix @@ -111,11 +106,8 @@ extension Collection where SubSequence == Self, Element: Equatable { } extension RangeReplaceableCollection where Element: Equatable { - /// Removes the initial elements that satisfy the given predicate from the - /// start of the sequence. - /// - Parameter predicate: A closure that takes an element of the sequence - /// as its argument and returns a Boolean value indicating whether the - /// element should be removed from the collection. + /// Removes `prefix` from the start of the collection. + /// - Parameter prefix: The collection to remove from this collection. @available(SwiftStdlib 5.7, *) public mutating func trimPrefix( _ prefix: Prefix @@ -127,11 +119,11 @@ extension RangeReplaceableCollection where Element: Equatable { // MARK: Regex algorithms extension BidirectionalCollection where SubSequence == Substring { - /// Returns a new collection of the same type by removing `prefix` from the - /// start. - /// - Parameter prefix: The collection to remove from this collection. + /// Returns a new collection of the same type by removing the initial elements + /// that matches the given regex. + /// - Parameter regex: The regex to remove from this collection. /// - Returns: A collection containing the elements that does not match - /// `prefix` from the start. + /// `regex` from the start. @_disfavoredOverload @available(SwiftStdlib 5.7, *) public func trimmingPrefix(_ regex: some RegexComponent) -> SubSequence {