Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: FavIcon/Utils.swift

Issue 29664569: Favicon: Issue 6245 - SwiftLinted project files (Closed)
Patch Set: Removed the sorted_imports rule and reversed the import calls to be sorted alphabetically Created Feb. 19, 2018, 10:38 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « FavIcon/URLRequestOperation.swift ('k') | FavIconTests/FavIconsTests.swift » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: FavIcon/Utils.swift
diff --git a/FavIcon/Utils.swift b/FavIcon/Utils.swift
index 5f738d3db092c50f32e51ad0057bb18ce426f179..b52108b74eea5c5be2e2cb8425b9dd906b120e41 100644
--- a/FavIcon/Utils.swift
+++ b/FavIcon/Utils.swift
@@ -48,22 +48,38 @@ extension String {
//swiftlint:disable cyclomatic_complexity
func parseAsStringEncoding() -> String.Encoding? {
switch lowercased() {
- case "iso-8859-1", "latin1": return String.Encoding.isoLatin1
- case "iso-8859-2", "latin2": return String.Encoding.isoLatin2
- case "iso-2022-jp": return String.Encoding.iso2022JP
- case "shift_jis": return String.Encoding.shiftJIS
- case "us-ascii": return String.Encoding.ascii
- case "utf-8": return String.Encoding.utf8
- case "utf-16": return String.Encoding.utf16
- case "utf-32": return String.Encoding.utf32
- case "utf-32be": return String.Encoding.utf32BigEndian
- case "utf-32le": return String.Encoding.utf32LittleEndian
- case "windows-1250": return String.Encoding.windowsCP1250
- case "windows-1251": return String.Encoding.windowsCP1251
- case "windows-1252": return String.Encoding.windowsCP1252
- case "windows-1253": return String.Encoding.windowsCP1253
- case "windows-1254": return String.Encoding.windowsCP1254
- case "x-mac-roman": return String.Encoding.macOSRoman
+ case "iso-8859-1", "latin1":
+ return String.Encoding.isoLatin1
+ case "iso-8859-2", "latin2":
+ return String.Encoding.isoLatin2
+ case "iso-2022-jp":
+ return String.Encoding.iso2022JP
+ case "shift_jis":
+ return String.Encoding.shiftJIS
+ case "us-ascii":
+ return String.Encoding.ascii
+ case "utf-8":
+ return String.Encoding.utf8
+ case "utf-16":
+ return String.Encoding.utf16
+ case "utf-32":
+ return String.Encoding.utf32
+ case "utf-32be":
+ return String.Encoding.utf32BigEndian
+ case "utf-32le":
+ return String.Encoding.utf32LittleEndian
+ case "windows-1250":
+ return String.Encoding.windowsCP1250
+ case "windows-1251":
+ return String.Encoding.windowsCP1251
+ case "windows-1252":
+ return String.Encoding.windowsCP1252
+ case "windows-1253":
+ return String.Encoding.windowsCP1253
+ case "windows-1254":
+ return String.Encoding.windowsCP1254
+ case "x-mac-roman":
+ return String.Encoding.macOSRoman
default:
return nil
}
« no previous file with comments | « FavIcon/URLRequestOperation.swift ('k') | FavIconTests/FavIconsTests.swift » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld