remove warnings
This commit is contained in:
parent
66622fffb3
commit
fafeebe185
@ -157,8 +157,6 @@ final class SocketPacket: CustomStringConvertible {
|
||||
}
|
||||
|
||||
private func completeMessage(var message:String, ack:Bool = false) -> String {
|
||||
var err:NSError?
|
||||
|
||||
if data == nil || data!.count == 0 {
|
||||
return message + "]"
|
||||
} else if !ack {
|
||||
@ -171,8 +169,7 @@ final class SocketPacket: CustomStringConvertible {
|
||||
do {
|
||||
jsonSend = try NSJSONSerialization.dataWithJSONObject(arg,
|
||||
options: NSJSONWritingOptions(rawValue: 0))
|
||||
} catch var error as NSError {
|
||||
err = error
|
||||
} catch {
|
||||
jsonSend = nil
|
||||
}
|
||||
let jsonString = NSString(data: jsonSend!, encoding: NSUTF8StringEncoding)
|
||||
|
||||
@ -24,15 +24,13 @@ public class SwiftRegex: NSObject, BooleanType {
|
||||
if let regex = swiftRegexCache[pattern] {
|
||||
self.regex = regex
|
||||
} else {
|
||||
var error: NSError?
|
||||
do {
|
||||
let regex = try NSRegularExpression(pattern: pattern, options:
|
||||
NSRegularExpressionOptions.DotMatchesLineSeparators)
|
||||
swiftRegexCache[pattern] = regex
|
||||
self.regex = regex
|
||||
} catch let error1 as NSError {
|
||||
error = error1
|
||||
SwiftRegex.failure("Error in pattern: \(pattern) - \(error)")
|
||||
SwiftRegex.failure("Error in pattern: \(pattern) - \(error1)")
|
||||
self.regex = NSRegularExpression()
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user