Skip to content

Commit

Permalink
change(SabyNetwork): make optionBlock escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
0xWOF committed Mar 22, 2024
1 parent ea5b57e commit c324063
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Source/Network/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public protocol Client<Request, Response> {
header: ClientHeader,
body: Request,
timeout: Interval?,
optionBlock: (inout URLRequest) -> Void
optionBlock: @escaping (inout URLRequest) -> Void
) -> Promise<ClientResult<Response>, Error>
}

Expand All @@ -30,7 +30,7 @@ extension Client {
method: ClientMethod = .get,
header: ClientHeader = [:],
timeout: Interval? = nil,
optionBlock: (inout URLRequest) -> Void = { _ in }
optionBlock: @escaping (inout URLRequest) -> Void = { _ in }
) -> Promise<ClientResult<Response>, Error> where RequestValue? == Request {
request(
url: url,
Expand All @@ -48,7 +48,7 @@ extension Client {
header: ClientHeader = [:],
body: Request,
timeout: Interval? = nil,
optionBlock: (inout URLRequest) -> Void = { _ in }
optionBlock: @escaping (inout URLRequest) -> Void = { _ in }
) -> Promise<ClientResult<Response>, Error> {
request(
url: url,
Expand Down
2 changes: 1 addition & 1 deletion Source/Network/Implement/Client/DataClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ extension DataClient {
header: ClientHeader = [:],
body: Data? = nil,
timeout: Interval? = nil,
optionBlock: (inout URLRequest) -> Void = { _ in }
optionBlock: @escaping (inout URLRequest) -> Void = { _ in }
) -> Promise<ClientResult<Data?>, Error> {
let pending = Promise<ClientResult<Data?>, Error>.pending()

Expand Down
2 changes: 1 addition & 1 deletion Source/Network/Implement/Client/JSONClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ extension JSONClient {
header: ClientHeader = [:],
body: JSON? = nil,
timeout: Interval? = nil,
optionBlock: (inout URLRequest) -> Void = { _ in }
optionBlock: @escaping (inout URLRequest) -> Void = { _ in }
) -> Promise<ClientResult<JSON>, Error> {
let header = header.merging([
"Content-Type": "application/json"
Expand Down

0 comments on commit c324063

Please sign in to comment.