Merge pull request #1303 from rudkx/fix-more-iuo-casts
Fix a couple more IUOs that were supposed to be banned by SE-0054.
diff --git a/Foundation/NSTimeZone.swift b/Foundation/NSTimeZone.swift
index 0d64795..7ccdd0a 100644
--- a/Foundation/NSTimeZone.swift
+++ b/Foundation/NSTimeZone.swift
@@ -99,7 +99,7 @@
public convenience init?(abbreviation: String) {
let abbr = abbreviation._cfObject
- guard let name = unsafeBitCast(CFDictionaryGetValue(CFTimeZoneCopyAbbreviationDictionary(), unsafeBitCast(abbr, to: UnsafeRawPointer.self)), to: NSString!.self) else {
+ guard let name = unsafeBitCast(CFDictionaryGetValue(CFTimeZoneCopyAbbreviationDictionary(), unsafeBitCast(abbr, to: UnsafeRawPointer.self)), to: NSString?.self) else {
return nil
}
self.init(name: name._swiftObject , data: nil)
diff --git a/Foundation/ProcessInfo.swift b/Foundation/ProcessInfo.swift
index baa9dab..a4acb20 100644
--- a/Foundation/ProcessInfo.swift
+++ b/Foundation/ProcessInfo.swift
@@ -88,7 +88,7 @@
}
let productVersionKey = unsafeBitCast(_kCFSystemVersionProductVersionKey, to: UnsafeRawPointer.self)
- guard let productVersion = unsafeBitCast(CFDictionaryGetValue(systemVersionDictionary, productVersionKey), to: NSString!.self) else {
+ guard let productVersion = unsafeBitCast(CFDictionaryGetValue(systemVersionDictionary, productVersionKey), to: NSString?.self) else {
return OperatingSystemVersion(majorVersion: fallbackMajor, minorVersion: fallbackMinor, patchVersion: fallbackPatch)
}