Skip to content

Commit 5df54d3

Browse files
authored
Merge pull request #138 from Carthage/se-0142
Utilize SE-0142
2 parents e070247 + 8658a40 commit 5df54d3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/Commandant/Command.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public protocol CommandProtocol {
1515
/// The command's options type.
1616
associatedtype Options: OptionsProtocol
1717

18-
associatedtype ClientError: Error = Options.ClientError
18+
associatedtype ClientError where ClientError == Options.ClientError
1919

2020
/// The action that users should specify to use this subcommand (e.g.,
2121
/// `help`).
@@ -39,7 +39,7 @@ public struct CommandWrapper<ClientError: Error> {
3939
public let usage: () -> CommandantError<ClientError>?
4040

4141
/// Creates a command that wraps another.
42-
fileprivate init<C: CommandProtocol>(_ command: C) where C.ClientError == ClientError, C.Options.ClientError == ClientError {
42+
fileprivate init<C: CommandProtocol>(_ command: C) where C.ClientError == ClientError {
4343
verb = command.verb
4444
function = command.function
4545
run = { (arguments: ArgumentParser) -> Result<(), CommandantError<ClientError>> in
@@ -93,7 +93,7 @@ public final class CommandRegistry<ClientError: Error> {
9393
@discardableResult
9494
public func register<C: CommandProtocol>(_ commands: C...)
9595
-> CommandRegistry
96-
where C.ClientError == ClientError, C.Options.ClientError == ClientError
96+
where C.ClientError == ClientError
9797
{
9898
for command in commands {
9999
commandsByVerb[command.verb] = CommandWrapper(command)

0 commit comments

Comments
 (0)