mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
stdlib: Address StrictMemorySafety warnings in String related code.
This commit is contained in:
@@ -236,7 +236,7 @@ extension _StringGuts {
|
||||
_ body: (UnsafePointer<Int8>) throws -> Result
|
||||
) rethrows -> Result {
|
||||
_internalInvariant(!_object.isFastZeroTerminated)
|
||||
return try String(self).utf8CString.withUnsafeBufferPointer {
|
||||
return try unsafe String(self).utf8CString.withUnsafeBufferPointer {
|
||||
let ptr = unsafe $0.baseAddress._unsafelyUnwrappedUnchecked
|
||||
return try unsafe body(ptr)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user