[stdlib] remove most uses of _asCChar and _asUInt8

This commit is contained in:
Guillaume Lessard
2022-04-06 15:21:00 -06:00
parent 8032a7c0c9
commit 8379b2422a
2 changed files with 11 additions and 9 deletions

View File

@@ -167,8 +167,7 @@ extension _StringGuts {
_ f: (UnsafeBufferPointer<CChar>) throws -> R
) rethrows -> R {
return try self.withFastUTF8 { utf8 in
let ptr = utf8.baseAddress._unsafelyUnwrappedUnchecked._asCChar
return try f(UnsafeBufferPointer(start: ptr, count: utf8.count))
return try utf8.withMemoryRebound(to: CChar.self, f)
}
}
}