瀏覽代碼

cast AnyObject always succeeds. Fix warning.

damuellen 10 年之前
父節點
當前提交
24956779ed
共有 1 個文件被更改,包括 1 次插入1 次删除
  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)