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 authored and Guillaume Lessard committed 2024-10-16 23:09:09 -07:00
1 parent afeecb6c28
commit 69e737de3d
1 file changed
+8 -2
+8 -2
View File
@@ -230,7 +230,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>(
@@ -272,7 +274,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 }