File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ extension String {
7777 }
7878
7979 @_alwaysEmitIntoClient
80- private init ( _checkingCString bytes: UnsafeBufferPointer < UInt8 > ) {
80+ internal init ( _checkingCString bytes: UnsafeBufferPointer < UInt8 > ) {
8181 guard let length = bytes. firstIndex ( of: 0 ) else {
8282 _preconditionFailure (
8383 " input of String.init(cString:) must be null-terminated "
Original file line number Diff line number Diff line change @@ -420,13 +420,14 @@ extension String {
420420 // check in String(decoding:as:).
421421 @_alwaysEmitIntoClient
422422 @inline ( never) // slow-path
423- private static func _fromNonContiguousUnsafeBitcastUTF8Repairing<
423+ internal static func _fromNonContiguousUnsafeBitcastUTF8Repairing<
424424 C: Collection
425425 > ( _ input: C ) -> ( result: String , repairsMade: Bool ) {
426426 _internalInvariant ( C . Element. self == UInt8 . self)
427427 return Array ( input) . withUnsafeBufferPointer {
428- let raw = UnsafeRawBufferPointer ( $0)
429- return String . _fromUTF8Repairing ( raw. bindMemory ( to: UInt8 . self) )
428+ UnsafeRawBufferPointer ( $0) . withMemoryRebound ( to: UInt8 . self) {
429+ String . _fromUTF8Repairing ( $0)
430+ }
430431 }
431432 }
432433
You can’t perform that action at this time.
0 commit comments