We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a77b8ce commit dd854faCopy full SHA for dd854fa
stdlib/public/core/String.swift
@@ -433,8 +433,9 @@ extension String {
433
>(_ input: C) -> (result: String, repairsMade: Bool) {
434
_internalInvariant(C.Element.self == UInt8.self)
435
return Array(input).withUnsafeBufferPointer {
436
- let raw = UnsafeRawBufferPointer($0)
437
- return String._fromUTF8Repairing(raw.bindMemory(to: UInt8.self))
+ UnsafeRawBufferPointer($0).withMemoryRebound(to: UInt8.self) {
+ String._fromUTF8Repairing($0)
438
+ }
439
}
440
441
0 commit comments