Skip to content

Commit d30661d

Browse files
authored
Fixes example snippets in CString.swift (#31407)
* Fixes example snippets in CString.swift * Fixes example snippet in CString.swift
1 parent ea293cf commit d30661d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

stdlib/public/core/CString.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ extension String {
7676
/// let s = String(validatingUTF8: ptr.baseAddress!)
7777
/// print(s)
7878
/// }
79-
/// // Prints "Optional(Café)"
79+
/// // Prints "Optional("Café")"
8080
///
8181
/// let invalidUTF8: [CChar] = [67, 97, 102, -61, 0]
8282
/// invalidUTF8.withUnsafeBufferPointer { ptr in
@@ -114,7 +114,7 @@ extension String {
114114
/// repairingInvalidCodeUnits: true)
115115
/// print(s)
116116
/// }
117-
/// // Prints "Optional((Café, false))"
117+
/// // Prints "Optional((result: "Café", repairsMade: false))"
118118
///
119119
/// let invalidUTF8: [UInt8] = [67, 97, 102, 195, 0]
120120
/// invalidUTF8.withUnsafeBufferPointer { ptr in
@@ -123,7 +123,7 @@ extension String {
123123
/// repairingInvalidCodeUnits: true)
124124
/// print(s)
125125
/// }
126-
/// // Prints "Optional((Caf�, true))"
126+
/// // Prints "Optional((result: "Caf�", repairsMade: true))"
127127
///
128128
/// - Parameters:
129129
/// - cString: A pointer to a null-terminated code sequence encoded in

0 commit comments

Comments
 (0)