Quellcode durchsuchen

cast AnyObject always succeeds. Fix warning.

damuellen vor 10 Jahren
Ursprung
Commit
24956779ed
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      Sources/HttpResponse.swift

+ 1 - 1
Sources/HttpResponse.swift

@@ -22,7 +22,7 @@ public enum HttpResponseBody {
         do {
             switch self {
             case .Json(let object):
-                guard let obj = object as? AnyObject where NSJSONSerialization.isValidJSONObject(obj) else {
+                guard case let obj = object where NSJSONSerialization.isValidJSONObject(obj) else {
                     throw SerializationError.InvalidObject
                 }
                 let json = try NSJSONSerialization.dataWithJSONObject(obj, options: NSJSONWritingOptions.PrettyPrinted)