Skip to content

Commit b400e3e

Browse files
author
Harlan Haskins
authored
Un-nest Error
1 parent 84311bb commit b400e3e

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Sources/Exercises/Participant.swift

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,25 @@ public protocol Participant {
2929
// ...
3030
}
3131

32+
// Errors that may be thrown from default implementations
33+
private enum ParticipantError: Error {
34+
case unsupported
35+
}
36+
3237
// Default impls
3338
extension Participant {
34-
enum Error: Swift.Error {
35-
case unsupported
36-
}
37-
3839
// Produce a function that will parse a grapheme break entry from a line
3940
public static func graphemeBreakProperty() throws -> (String) -> GraphemeBreakEntry? {
40-
throw Error.unsupported
41+
throw ParticipantError.unsupported
4142
}
4243

4344
// Produce a function that will extract the bodies of C-style comments from its input
4445
public static func cComments() throws -> (String) -> [Substring] {
45-
throw Error.unsupported
46+
throw ParticipantError.unsupported
4647
}
4748

4849
// Produce a function that will extract the bodies of Swift-style comments from its input
4950
public static func swiftComments() throws -> (String) -> [Substring] {
50-
throw Error.unsupported
51+
throw ParticipantError.unsupported
5152
}
5253
}

0 commit comments

Comments
 (0)