Generate SystemString.string consistently

- SystemString.string and Slice<SystemString>.string should be generated in the same manner. Now they are.
This commit is contained in:
Guillaume Lessard committed 2024-03-08 12:13:04 -08:00
1 parent 8441d4a310
commit afb7fa4eef
1 file changed
+8 -2
+8 -2
View File
@@ -202,7 +202,9 @@ extension Slice where Base == SystemString {
}
internal var string: String {
withCodeUnits { String(decoding: $0, as: CInterop.PlatformUnicodeEncoding.self) }
withCodeUnits {
String(decoding: $0, as: CInterop.PlatformUnicodeEncoding.self)
}
}
internal func withPlatformString<T>(
@@ -244,7 +246,11 @@ extension SystemString: ExpressibleByStringLiteral {
}
extension SystemString: CustomStringConvertible, CustomDebugStringConvertible {
internal var string: String { String(decoding: self) }
internal var string: String {
self.withCodeUnits {
String(decoding: $0, as: CInterop.PlatformUnicodeEncoding.self)
}
}
internal var description: String { string }
internal var debugDescription: String { description.debugDescription }