Skip to content

Commit

Permalink
Add reverted code path for pre 5.9
Browse files Browse the repository at this point in the history
  • Loading branch information
STREGA committed Sep 30, 2023
1 parent 5969630 commit a3ffd95
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Sources/CartonHelpers/Async.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,17 @@ extension Sequence {
}

/// A type that can be executed as part of a nested tree of commands.
#if swift(<5.9)
public protocol AsyncParsableCommand: ParsableCommand {
mutating func run() async throws
}
#else
extension AsyncParsableCommand {
public mutating func run() throws {
throw CleanExit.helpRequest(self)
}
}
#endif

public protocol AsyncMain {
associatedtype Command: ParsableCommand
Expand Down

0 comments on commit a3ffd95

Please sign in to comment.