From fc4edf76d76e0f502e61756e51b510c1f2f0d3c4 Mon Sep 17 00:00:00 2001 From: Luciano Almeida Date: Wed, 1 May 2019 11:34:25 -0300 Subject: [PATCH] Update Generic constraints. --- Cartfile.resolved | 6 +++--- Sources/RxMoya/Observable+Response.swift | 12 ++++++------ Sources/RxMoya/Single+Response.swift | 10 +++++----- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Cartfile.resolved b/Cartfile.resolved index 6c358e619..7ce6c7ab3 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,7 +1,7 @@ github "Alamofire/Alamofire" "4.8.2" github "AliSoftware/OHHTTPStubs" "7.0.0" github "Quick/Nimble" "v8.0.1" -github "Quick/Quick" "v2.0.0" -github "ReactiveCocoa/ReactiveSwift" "5.0.0" -github "ReactiveX/RxSwift" "4.4.2" +github "Quick/Quick" "v2.1.0" +github "ReactiveCocoa/ReactiveSwift" "5.0.1" +github "ReactiveX/RxSwift" "5.0.1" github "antitypical/Result" "4.1.0" diff --git a/Sources/RxMoya/Observable+Response.swift b/Sources/RxMoya/Observable+Response.swift index 4af5aedf0..ab4aa393b 100644 --- a/Sources/RxMoya/Observable+Response.swift +++ b/Sources/RxMoya/Observable+Response.swift @@ -11,25 +11,25 @@ import RxSwift #endif /// Extension for processing raw NSData generated by network access. -extension ObservableType where E == Response { +extension ObservableType where Element == Response { /// Filters out responses that don't fall within the given range, generating errors when others are encountered. - public func filter(statusCodes: R) -> Observable where R.Bound == Int { + public func filter(statusCodes: R) -> Observable where R.Bound == Int { return flatMap { Observable.just(try $0.filter(statusCodes: statusCodes)) } } /// Filters out responses that has the specified `statusCode`. - public func filter(statusCode: Int) -> Observable { + public func filter(statusCode: Int) -> Observable { return flatMap { Observable.just(try $0.filter(statusCode: statusCode)) } } /// Filters out responses where `statusCode` falls within the range 200 - 299. - public func filterSuccessfulStatusCodes() -> Observable { + public func filterSuccessfulStatusCodes() -> Observable { return flatMap { Observable.just(try $0.filterSuccessfulStatusCodes()) } } /// Filters out responses where `statusCode` falls within the range 200 - 399 - public func filterSuccessfulStatusAndRedirectCodes() -> Observable { + public func filterSuccessfulStatusAndRedirectCodes() -> Observable { return flatMap { Observable.just(try $0.filterSuccessfulStatusAndRedirectCodes()) } } @@ -54,7 +54,7 @@ extension ObservableType where E == Response { } } -extension ObservableType where E == ProgressResponse { +extension ObservableType where Element == ProgressResponse { /** Filter completed progress response and maps to actual response diff --git a/Sources/RxMoya/Single+Response.swift b/Sources/RxMoya/Single+Response.swift index ec812d732..53adbe579 100644 --- a/Sources/RxMoya/Single+Response.swift +++ b/Sources/RxMoya/Single+Response.swift @@ -11,25 +11,25 @@ import RxSwift #endif /// Extension for processing raw NSData generated by network access. -extension PrimitiveSequence where TraitType == SingleTrait, ElementType == Response { +extension PrimitiveSequence where Trait == SingleTrait, Element == Response { /// Filters out responses that don't fall within the given closed range, generating errors when others are encountered. - public func filter(statusCodes: R) -> Single where R.Bound == Int { + public func filter(statusCodes: R) -> Single where R.Bound == Int { return flatMap { .just(try $0.filter(statusCodes: statusCodes)) } } /// Filters out responses that have the specified `statusCode`. - public func filter(statusCode: Int) -> Single { + public func filter(statusCode: Int) -> Single { return flatMap { .just(try $0.filter(statusCode: statusCode)) } } /// Filters out responses where `statusCode` falls within the range 200 - 299. - public func filterSuccessfulStatusCodes() -> Single { + public func filterSuccessfulStatusCodes() -> Single { return flatMap { .just(try $0.filterSuccessfulStatusCodes()) } } /// Filters out responses where `statusCode` falls within the range 200 - 399 - public func filterSuccessfulStatusAndRedirectCodes() -> Single { + public func filterSuccessfulStatusAndRedirectCodes() -> Single { return flatMap { .just(try $0.filterSuccessfulStatusAndRedirectCodes()) } }