Skip to content

Commit 509eff3

Browse files
committed
Minor update for SE-0089
1 parent 31bf0ab commit 509eff3

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

Foundation/NSBundle.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public class Bundle: NSObject {
6363
}
6464

6565
override public var description: String {
66-
return "\(String(Bundle.self)) <\(bundleURL.path!)> (\(isLoaded ? "loaded" : "not yet loaded"))"
66+
return "\(String(describing: Bundle.self)) <\(bundleURL.path!)> (\(isLoaded ? "loaded" : "not yet loaded"))"
6767
}
6868

6969

Foundation/NSHost.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public class Host: NSObject {
9494
let lookupInfo = { (content: inout [String], flags: Int32) in
9595
let hname = UnsafeMutablePointer<Int8>.allocate(capacity: 1024)
9696
if (getnameinfo(info.ai_addr, sa_len, hname, 1024, nil, 0, flags) == 0) {
97-
content.append(String(hname))
97+
content.append(String(describing: hname))
9898
}
9999
hname.deinitialize()
100100
hname.deallocate(capacity: 1024)

Foundation/NSJSONSerialization.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ private struct JSONReader {
598598
}
599599

600600
if !UTF16.isLeadSurrogate(codeUnit) {
601-
return (String(UnicodeScalar(codeUnit)), index)
601+
return (String(UnicodeScalar(codeUnit)!), index)
602602
}
603603

604604
guard let (trailCodeUnit, finalIndex) = try consumeASCIISequence("\\u", input: index).flatMap(parseCodeUnit) where UTF16.isTrailSurrogate(trailCodeUnit) else {
@@ -609,7 +609,7 @@ private struct JSONReader {
609609

610610
let highValue = (UInt32(codeUnit - 0xD800) << 10)
611611
let lowValue = UInt32(trailCodeUnit - 0xDC00)
612-
return (String(UnicodeScalar(highValue + lowValue + 0x10000)), finalIndex)
612+
return (String(UnicodeScalar(highValue + lowValue + 0x10000)!), finalIndex)
613613
}
614614

615615
func isHexChr(_ byte: UInt8) -> Bool {

Foundation/NSKeyedArchiver.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,14 +238,14 @@ public class NSKeyedArchiver : NSCoder {
238238
}
239239

240240
public class func setClassName(_ codedName: String?, for cls: AnyClass) {
241-
let clsName = String(cls.dynamicType)
241+
let clsName = String(describing: cls.dynamicType)
242242
_classNameMapLock.synchronized {
243243
_classNameMap[clsName] = codedName
244244
}
245245
}
246246

247247
public func setClassName(_ codedName: String?, for cls: AnyClass) {
248-
let clsName = String(cls.dynamicType)
248+
let clsName = String(describing: cls.dynamicType)
249249
_classNameMap[clsName] = codedName
250250
}
251251

0 commit comments

Comments
 (0)