Skip to content

Commit 4479f4d

Browse files
mluisbrowndmcrodrigues
authored andcommitted
Fix Swift 3.1 warnings (#73)
1 parent 20a8307 commit 4479f4d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Vinyl/Response.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ func ==(lhs: Response, rhs: Response) -> Bool {
6060
extension Response: Hashable {
6161

6262
var hashValue: Int {
63-
let body = self.body == nil ? "\(self.body)" : ""
64-
let error = self.error == nil ? "\(self.error)" : ""
63+
let body = self.body.map { "\($0)" } ?? ""
64+
let error = self.error.map { "\($0)" } ?? ""
6565

66-
return "\(urlResponse?.hashValue):\((body)):\(error)".hashValue
66+
return "\(urlResponse?.hashValue ?? 0):\((body)):\(error)".hashValue
6767
}
6868
}

0 commit comments

Comments
 (0)