Skip to content

Fix warning for matching enum with associated values as tuples. #2741

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 23, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ internal extension _HTTPURLProtocol._ResponseHeaderLines {
extension HTTPURLResponse {
fileprivate convenience init?(message: _HTTPURLProtocol._HTTPMessage, URL: URL) {
/// This needs to be a request, i.e. it needs to have a status line.
guard case .statusLine(let statusLine) = message.startLine else { return nil }
guard case .statusLine(let version, let status, _) = message.startLine else { return nil }
let fields = message.headersAsDictionary
self.init(url: URL, statusCode: statusLine.status, httpVersion: statusLine.version.rawValue, headerFields: fields)
self.init(url: URL, statusCode: status, httpVersion: version.rawValue, headerFields: fields)
}
}

Expand Down