diff --git a/Sources/Models/Converters/JSONYAMLConversionMode.swift b/Sources/Models/Converters/JSONYAMLConversionMode.swift index 4a9192d..2321363 100644 --- a/Sources/Models/Converters/JSONYAMLConversionMode.swift +++ b/Sources/Models/Converters/JSONYAMLConversionMode.swift @@ -8,8 +8,8 @@ extension JSONYAMLConversionMode: CaseIterable {} extension JSONYAMLConversionMode: CustomStringConvertible { var description: String { switch self { - case .yamlToJSON: return "YAML to JSON" - case .jsonToYAML: return "JSON to YAML" + case .yamlToJSON: "YAML to JSON" + case .jsonToYAML: "JSON to YAML" } } } diff --git a/Sources/Models/Converters/NumberType.swift b/Sources/Models/Converters/NumberType.swift index d6d0383..7aa77d6 100644 --- a/Sources/Models/Converters/NumberType.swift +++ b/Sources/Models/Converters/NumberType.swift @@ -6,28 +6,28 @@ enum NumberType: String { var radix: Int { switch self { - case .hexadecimal: return 16 - case .decimal: return 10 - case .octal: return 8 - case .binary: return 2 + case .hexadecimal: 16 + case .decimal: 10 + case .octal: 8 + case .binary: 2 } } var digitsInGroup: Int { switch self { - case .hexadecimal: return 4 - case .decimal: return 3 - case .octal: return 3 - case .binary: return 4 + case .hexadecimal: 4 + case .decimal: 3 + case .octal: 3 + case .binary: 4 } } var separator: String { switch self { - case .hexadecimal: return " " - case .decimal: return "," - case .octal: return " " - case .binary: return " " + case .hexadecimal: " " + case .decimal: "," + case .octal: " " + case .binary: " " } } } diff --git a/Sources/Models/Formatters/JSONFormatter.swift b/Sources/Models/Formatters/JSONFormatter.swift index ab11157..c8fe2c5 100644 --- a/Sources/Models/Formatters/JSONFormatter.swift +++ b/Sources/Models/Formatters/JSONFormatter.swift @@ -5,14 +5,10 @@ struct JSONFormatter { func format(_ input: String) -> String { switch self.indentation { - case .twoSpaces: - return SwiftJSONFormatter.beautify(input, indent: " ") - case .fourSpaces: - return SwiftJSONFormatter.beautify(input, indent: " ") - case .oneTab: - return SwiftJSONFormatter.beautify(input, indent: "\t") - case .minified: - return SwiftJSONFormatter.minify(input) + case .twoSpaces: SwiftJSONFormatter.beautify(input, indent: " ") + case .fourSpaces: SwiftJSONFormatter.beautify(input, indent: " ") + case .oneTab: SwiftJSONFormatter.beautify(input, indent: "\t") + case .minified: SwiftJSONFormatter.minify(input) } } } diff --git a/Sources/Models/Formatters/JSONIndentation.swift b/Sources/Models/Formatters/JSONIndentation.swift index 126d329..39e834d 100644 --- a/Sources/Models/Formatters/JSONIndentation.swift +++ b/Sources/Models/Formatters/JSONIndentation.swift @@ -8,10 +8,10 @@ enum JSONIndentation { extension JSONIndentation: CustomStringConvertible { var description: String { switch self { - case .twoSpaces: return "2 spaces" - case .fourSpaces: return "4 spaces" - case .oneTab: return "1 tab" - case .minified: return "Minified" + case .twoSpaces: "2 spaces" + case .fourSpaces: "4 spaces" + case .oneTab: "1 tab" + case .minified: "Minified" } } } diff --git a/Sources/Models/Generators/UUIDVersion.swift b/Sources/Models/Generators/UUIDVersion.swift index 15b2b3e..28cde23 100644 --- a/Sources/Models/Generators/UUIDVersion.swift +++ b/Sources/Models/Generators/UUIDVersion.swift @@ -6,8 +6,8 @@ enum UUIDVersion { extension UUIDVersion: CustomStringConvertible { var description: String { switch self { - case .v1: return "1" - case .v4: return "4 (GUID)" + case .v1: "1" + case .v4: "4 (GUID)" } } } diff --git a/Sources/Pages/Converters/NumberBaseConverterViewState.swift b/Sources/Pages/Converters/NumberBaseConverterViewState.swift index 436c20b..2748893 100644 --- a/Sources/Pages/Converters/NumberBaseConverterViewState.swift +++ b/Sources/Pages/Converters/NumberBaseConverterViewState.swift @@ -40,10 +40,10 @@ final class NumberBaseConverterViewState { var input: String { switch self.inputType { - case .hexadecimal: return self.hexadecimal - case .decimal: return self.decimal - case .octal: return self.octal - case .binary: return self.binary + case .hexadecimal: self.hexadecimal + case .decimal: self.decimal + case .octal: self.octal + case .binary: self.binary } } diff --git a/Sources/Tool.swift b/Sources/Tool.swift index 2193293..8f2a2fd 100644 --- a/Sources/Tool.swift +++ b/Sources/Tool.swift @@ -58,79 +58,79 @@ enum Tool: String { var strings: Strings { switch self { case .allTools: - return .init( + .init( shortTitle: "All tools", longTitle: "All tools", description: "" ) case .base64Coder: - return .init( + .init( shortTitle: "Base 64", longTitle: "Base 64 Encoder / Decoder", description: "Encode and decode Base64 data" ) case .hashGenerator: - return .init( + .init( shortTitle: "Hash", longTitle: "Hash Generator", description: "Calculate MD5, SHA1, SHA256 and SHA512 hash from text data" ) case .htmlCoder: - return .init( + .init( shortTitle: "HTML", longTitle: "HTML Encoder / Decoder", description: "Encode or decode all the applicable characters to their corresponding HTML entities" ) case .jsonFormatter: - return .init( + .init( shortTitle: "JSON", longTitle: "JSON Formatter", description: "Indent or minify JSON data" ) case .jsonYAMLConverter: - return .init( + .init( shortTitle: "JSON <> YAML", longTitle: "JSON <> YAML Converter", description: "Convert JSON data to YAML and vice versa" ) case .jwtDecoder: - return .init( + .init( shortTitle: "JWT Decoder", longTitle: "JWT Decoder", description: "Decode a JWT header, payload and signature" ) case .loremIpsumGenerator: - return .init( + .init( shortTitle: "Lorem Ipsum", longTitle: "Lorem Ipsum Generator", description: "Generate Lorem Ipsum placeholder text" ) case .markdownPreview: - return .init( + .init( shortTitle: "Markdown Preview", longTitle: "Markdown Preview", description: "Preview a Markdown document" ) case .numberBaseConverter: - return .init( + .init( shortTitle: "Number Base", longTitle: "Number Base Converter", description: "Convert numbers from one base to another" ) case .timestampConverter: - return .init( + .init( shortTitle: "Timestamp", longTitle: "Unix Timestamp Converter", description: "Convert timestamp to human-readable date and vice versa" ) case .urlCoder: - return .init( + .init( shortTitle: "URL", longTitle: "URL Encoder / Decoder", description: "Encode or decode all the applicable characters to their corresponding URL entities" ) case .uuidGenerator: - return .init( + .init( shortTitle: "UUID", longTitle: "UUID Generator", description: "Generate UUIDs version 1 and 4"