Skip to content

Commit 32cfece

Browse files
authored
Merge pull request #1303 from rudkx/fix-more-iuo-casts
Fix a couple more IUOs that were supposed to be banned by SE-0054.
2 parents 24ac050 + 86d2cae commit 32cfece

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Foundation/NSTimeZone.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ open class NSTimeZone : NSObject, NSCopying, NSSecureCoding, NSCoding {
9999

100100
public convenience init?(abbreviation: String) {
101101
let abbr = abbreviation._cfObject
102-
guard let name = unsafeBitCast(CFDictionaryGetValue(CFTimeZoneCopyAbbreviationDictionary(), unsafeBitCast(abbr, to: UnsafeRawPointer.self)), to: NSString!.self) else {
102+
guard let name = unsafeBitCast(CFDictionaryGetValue(CFTimeZoneCopyAbbreviationDictionary(), unsafeBitCast(abbr, to: UnsafeRawPointer.self)), to: NSString?.self) else {
103103
return nil
104104
}
105105
self.init(name: name._swiftObject , data: nil)

Foundation/ProcessInfo.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ open class ProcessInfo: NSObject {
8888
}
8989

9090
let productVersionKey = unsafeBitCast(_kCFSystemVersionProductVersionKey, to: UnsafeRawPointer.self)
91-
guard let productVersion = unsafeBitCast(CFDictionaryGetValue(systemVersionDictionary, productVersionKey), to: NSString!.self) else {
91+
guard let productVersion = unsafeBitCast(CFDictionaryGetValue(systemVersionDictionary, productVersionKey), to: NSString?.self) else {
9292
return OperatingSystemVersion(majorVersion: fallbackMajor, minorVersion: fallbackMinor, patchVersion: fallbackPatch)
9393
}
9494

0 commit comments

Comments
 (0)