Skip to content

Commit

Permalink
Improve comments for PathBuilder functions
Browse files Browse the repository at this point in the history
  • Loading branch information
mkj-is committed May 16, 2021
1 parent a1cac5a commit a5580af
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Sources/PathBuilder/PathBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,26 @@ public struct PathBuilder {
component ?? EmptySubpath()
}

/// With buildEither(second:), enables support for 'if-else' and 'switch'
/// With `buildEither(second:)`, enables support for 'if-else' and 'switch'
/// statements by folding conditional results into a single result.
public static func buildEither(first: PathComponent) -> PathComponent {
first
}

/// With buildEither(first:), enables support for 'if-else' and 'switch'
/// With `buildEither(first:)`, enables support for 'if-else' and 'switch'
/// statements by folding conditional results into a single result.
public static func buildEither(second: PathComponent) -> PathComponent {
second
}

/// This will be called on the partial result of an 'if
/// #available' block to allow the result builder to erase type
/// information.
/// This will be called on the partial result of an 'if #available'
/// block to allow the result builder to erase type information.
public static func buildLimitedAvailability(_ component: PathComponent) -> PathComponent {
component
}

/// This will be called on the partial result from the outermost
/// block statement to produce the final returned result Path.
/// block statement to produce the final returned result `Path`.
public static func buildFinalResult(_ component: PathComponent) -> Path {
Path { path in
component.add(to: &path)
Expand Down

0 comments on commit a5580af

Please sign in to comment.