|
10 | 10 | import RxSwift
|
11 | 11 | #endif
|
12 | 12 |
|
13 |
| -public enum SequenceMaterializeResult<T> { |
| 13 | +public enum MaterializedSequenceResult<T> { |
14 | 14 | case completed(elements: [T])
|
15 | 15 | case failed(elements: [T], error: Error)
|
16 | 16 | }
|
@@ -88,13 +88,13 @@ extension BlockingObservable {
|
88 | 88 | /// The sequence is materialized as a result type capturing how the sequence terminated (completed or error), along with any elements up to that point.
|
89 | 89 | ///
|
90 | 90 | /// - returns: On completion, returns the list of elements in the sequence. On error, returns the list of elements up to that point, along with the error itself.
|
91 |
| - public func materialize() -> SequenceMaterializeResult<E> { |
| 91 | + public func materialize() -> MaterializedSequenceResult<E> { |
92 | 92 | return materializeResult()
|
93 | 93 | }
|
94 | 94 | }
|
95 | 95 |
|
96 | 96 | extension BlockingObservable {
|
97 |
| - fileprivate func materializeResult(max: Int? = nil, predicate: @escaping (E) throws -> Bool = { _ in true }) -> SequenceMaterializeResult<E> { |
| 97 | + fileprivate func materializeResult(max: Int? = nil, predicate: @escaping (E) throws -> Bool = { _ in true }) -> MaterializedSequenceResult<E> { |
98 | 98 | var elements: [E] = Array<E>()
|
99 | 99 | var error: Swift.Error?
|
100 | 100 |
|
@@ -146,13 +146,13 @@ extension BlockingObservable {
|
146 | 146 | }
|
147 | 147 |
|
148 | 148 | if let error = error {
|
149 |
| - return SequenceMaterializeResult.failed(elements: elements, error: error) |
| 149 | + return MaterializedSequenceResult.failed(elements: elements, error: error) |
150 | 150 | }
|
151 | 151 |
|
152 |
| - return SequenceMaterializeResult.completed(elements: elements) |
| 152 | + return MaterializedSequenceResult.completed(elements: elements) |
153 | 153 | }
|
154 | 154 |
|
155 |
| - fileprivate func elementsOrThrow(_ results: SequenceMaterializeResult<E>) throws -> [E] { |
| 155 | + fileprivate func elementsOrThrow(_ results: MaterializedSequenceResult<E>) throws -> [E] { |
156 | 156 | switch results {
|
157 | 157 | case .failed(_, let error):
|
158 | 158 | throw error
|
|
0 commit comments