Skip to content

Commit 06ba9b0

Browse files
authored
Merge pull request #19 from Project-OSRM/1ec5-swift3.1
Fix Swift 3.1 warnings
2 parents f62a2bc + 33b86e5 commit 06ba9b0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

OSRMTextInstructions/OSRMTextInstructions.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class OSRMInstructionFormatter: Formatter {
3131
}
3232

3333
required public init?(coder decoder: NSCoder) {
34-
if let version = decoder.decodeObject(of: NSString.self, forKey: "version") as? String {
34+
if let version = decoder.decodeObject(of: NSString.self, forKey: "version") as String? {
3535
self.version = version
3636
} else {
3737
return nil
@@ -240,7 +240,7 @@ public class OSRMInstructionFormatter: Formatter {
240240
var buffer: NSString?
241241

242242
if scanner.scanUpTo("{", into: &buffer) {
243-
result += buffer as! String
243+
result += buffer! as String
244244
}
245245
guard scanner.scanString("{", into: nil) else {
246246
continue
@@ -252,7 +252,7 @@ public class OSRMInstructionFormatter: Formatter {
252252
}
253253

254254
if scanner.scanString("}", into: nil) {
255-
if let tokenType = TokenType(description: token as! String) {
255+
if let tokenType = TokenType(description: token! as String) {
256256
var replacement: String
257257
switch tokenType {
258258
case .wayName: replacement = wayName
@@ -271,7 +271,7 @@ public class OSRMInstructionFormatter: Formatter {
271271
}
272272
}
273273
} else {
274-
result += token as! String
274+
result += token! as String
275275
}
276276

277277
}

0 commit comments

Comments
 (0)