We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
String.Encoding(ianaName:)
1 parent d4ab876 commit cf9ed49Copy full SHA for cf9ed49
Sources/FoundationEssentials/String/String+Encoding+Names.swift
@@ -143,22 +143,13 @@ extension String.Encoding {
143
.utf32LittleEndian,
144
]
145
146
- func __determineEncoding() -> String.Encoding? {
147
- for encoding in possibilities {
148
- guard let ianaCharset = encoding._ianaCharset else {
149
- continue
150
- }
151
- if ianaCharset.matches(charsetName) {
152
- return encoding
153
+ for encoding in possibilities {
+ if encoding._ianaCharset!.matches(charsetName) {
+ self = encoding
+ return
154
}
155
- return nil
156
157
-
158
- guard let encoding = __determineEncoding() else {
159
160
161
- self = encoding
+ return nil
162
163
164
0 commit comments