Skip to content

Cleaning up some comments #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/Algorithms/Combinations.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Sources/Algorithms/Rotate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
22 changes: 10 additions & 12 deletions Sources/Algorithms/Trim.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down