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 {
77
77
}
78
78
79
79
@_alwaysEmitIntoClient
80
- private init ( _checkingCString bytes: UnsafeBufferPointer < UInt8 > ) {
80
+ internal init ( _checkingCString bytes: UnsafeBufferPointer < UInt8 > ) {
81
81
guard let length = bytes. firstIndex ( of: 0 ) else {
82
82
_preconditionFailure (
83
83
" 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 {
420
420
// check in String(decoding:as:).
421
421
@_alwaysEmitIntoClient
422
422
@inline ( never) // slow-path
423
- private static func _fromNonContiguousUnsafeBitcastUTF8Repairing<
423
+ internal static func _fromNonContiguousUnsafeBitcastUTF8Repairing<
424
424
C: Collection
425
425
> ( _ input: C ) -> ( result: String , repairsMade: Bool ) {
426
426
_internalInvariant ( C . Element. self == UInt8 . self)
427
427
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
+ }
430
431
}
431
432
}
432
433
You can’t perform that action at this time.
0 commit comments