@@ -25,14 +25,14 @@ public enum AsyncStatus<Success, Failure: Error> {
25
25
/// If this instance represents a `pending` or a `running`, this returns nil.
26
26
public var result : Result < Success , Failure > ? {
27
27
switch self {
28
- case . pending, . running:
29
- return nil
28
+ case . pending, . running:
29
+ return nil
30
30
31
- case . success( let success) :
32
- return . success( success)
31
+ case . success( let success) :
32
+ return . success( success)
33
33
34
- case . failure( let error) :
35
- return . failure( error)
34
+ case . failure( let error) :
35
+ return . failure( error)
36
36
}
37
37
}
38
38
@@ -55,17 +55,17 @@ public enum AsyncStatus<Success, Failure: Error> {
55
55
/// - Returns: An `AsyncStatus` instance, either from the closure or the previous `.success`.
56
56
public func flatMap< NewSuccess> ( _ transform: ( Success ) -> AsyncStatus < NewSuccess , Failure > ) -> AsyncStatus < NewSuccess , Failure > {
57
57
switch self {
58
- case . pending:
59
- return . pending
58
+ case . pending:
59
+ return . pending
60
60
61
- case . running:
62
- return . running
61
+ case . running:
62
+ return . running
63
63
64
- case . success( let value) :
65
- return transform ( value)
64
+ case . success( let value) :
65
+ return transform ( value)
66
66
67
- case . failure( let error) :
68
- return . failure( error)
67
+ case . failure( let error) :
68
+ return . failure( error)
69
69
}
70
70
}
71
71
@@ -74,17 +74,17 @@ public enum AsyncStatus<Success, Failure: Error> {
74
74
/// - Returns: An `AsyncStatus` instance, either from the closure or the previous `.failure`.
75
75
public func flatMapError< NewFailure: Error > ( _ transform: ( Failure ) -> AsyncStatus < Success , NewFailure > ) -> AsyncStatus < Success , NewFailure > {
76
76
switch self {
77
- case . pending:
78
- return . pending
77
+ case . pending:
78
+ return . pending
79
79
80
- case . running:
81
- return . running
80
+ case . running:
81
+ return . running
82
82
83
- case . success( let value) :
84
- return . success( value)
83
+ case . success( let value) :
84
+ return . success( value)
85
85
86
- case . failure( let error) :
87
- return transform ( error)
86
+ case . failure( let error) :
87
+ return transform ( error)
88
88
}
89
89
}
90
90
@@ -96,14 +96,14 @@ public enum AsyncStatus<Success, Failure: Error> {
96
96
/// - Returns: The success value, if the instance represents a success,If the status is `pending` or `running`, this returns nil. .
97
97
public func get( ) throws -> Success ? {
98
98
switch self {
99
- case . pending, . running:
100
- return nil
99
+ case . pending, . running:
100
+ return nil
101
101
102
- case . success( let value) :
103
- return value
102
+ case . success( let value) :
103
+ return value
104
104
105
- case . failure( let error) :
106
- throw error
105
+ case . failure( let error) :
106
+ throw error
107
107
}
108
108
}
109
109
}
0 commit comments