Skip to content

Commit

Permalink
Fix build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanlabelle committed Aug 26, 2023
1 parent 8ba05bc commit 0896f3d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Sources/HTTPWebDriver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ public struct HTTPWebDriver: WebDriver {
// Send a WebDriverRequest to the web driver local service
// TODO: consider making this function async/awaitable
@discardableResult
public func send<Request>(_ request: Request) throws -> Request.Response where Request: WebDriverRequest {
let urlRequest = Self.buildURLRequest(request)
public func send<Request: WebDriverRequest>(_ request: Request) throws -> Request.Response {
let urlRequest = try buildURLRequest(request)

// Send the request and decode result or error
let (status, responseData) = try urlRequest.send()
Expand All @@ -24,7 +24,7 @@ public struct HTTPWebDriver: WebDriver {
return try JSONDecoder().decode(Request.Response.self, from: responseData)
}

private static func buildURLRequest<Request>(_ request: Request) throws -> URLRequest {
private func buildURLRequest<Request: WebDriverRequest>(_ request: Request) throws -> URLRequest {
var url = rootURL
for pathComponent in request.pathComponents {
url.appendPathComponent(pathComponent)
Expand Down
2 changes: 1 addition & 1 deletion Sources/WebDriverRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public protocol WebDriverRequest {
var body: Body { get }
}

extension WebDriverRequest where ResponseValue = CodableNone {
extension WebDriverRequest where Body == CodableNone {
var body: Body { .init() }
}

Expand Down

0 comments on commit 0896f3d

Please sign in to comment.