File tree Expand file tree Collapse file tree 2 files changed +4
-15
lines changed
Expand file tree Collapse file tree 2 files changed +4
-15
lines changed Original file line number Diff line number Diff line change @@ -262,13 +262,10 @@ public enum TaskEvent<T>: TaskEventType {
262262
263263 /// The resulting value, if the event is `Success`.
264264 public var value : T ? {
265- switch self {
266- case . Launch, . StandardOutput, . StandardError:
267- return nil
268-
269- case let . Success( value) :
265+ if case let . Success( value) = self {
270266 return value
271267 }
268+ return nil
272269 }
273270
274271 /// Maps over the value embedded in a `Success` event.
Original file line number Diff line number Diff line change @@ -35,12 +35,8 @@ class TaskSpec: QuickSpec {
3535 it ( " should launch a task that writes to stdout " ) {
3636 let result = launchTask ( Task ( " /bin/echo " , arguments: [ " foobar " ] ) )
3737 . reduce ( NSMutableData ( ) ) { aggregated, event in
38- switch event {
39- case let . StandardOutput( data) :
38+ if case let . StandardOutput( data) = event {
4039 aggregated. appendData ( data)
41-
42- default :
43- break
4440 }
4541
4642 return aggregated
@@ -56,12 +52,8 @@ class TaskSpec: QuickSpec {
5652 it ( " should launch a task that writes to stderr " ) {
5753 let result = launchTask ( Task ( " /usr/bin/stat " , arguments: [ " not-a-real-file " ] ) )
5854 . reduce ( NSMutableData ( ) ) { aggregated, event in
59- switch event {
60- case let . StandardError( data) :
55+ if case let . StandardError( data) = event {
6156 aggregated. appendData ( data)
62-
63- default :
64- break
6557 }
6658
6759 return aggregated
You can’t perform that action at this time.
0 commit comments