Skip to content

Commit 3411deb

Browse files
Merge pull request #1870 from airspeedswift/unsafe-cstring-conversion
Switch to using correct form for unsafe type cast
2 parents e95ace3 + a2f9736 commit 3411deb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Foundation/NSString.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ open class NSString : NSObject, NSCopying, NSMutableCopying, NSSecureCoding, NSC
301301
}
302302
if type(of: self) == NSString.self || type(of: self) == NSMutableString.self {
303303
if _storage._guts._isContiguousASCII {
304-
return UnsafePointer<Int8>(_storage._guts.startASCII);
304+
return UnsafeRawPointer(_storage._guts.startASCII).assumingMemoryBound(to: Int8.self)
305305
}
306306
}
307307
return nil

0 commit comments

Comments
 (0)