From 2380ade53da780220749cf704e1045ad4501a9a2 Mon Sep 17 00:00:00 2001 From: Mahdi Bahrami Date: Sat, 13 Jul 2024 00:42:33 +0330 Subject: [PATCH] Update README.md --- README.md | 106 +++++++++++++++++++++++++++--------------------------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/README.md b/README.md index 45a2908..c67622f 100644 --- a/README.md +++ b/README.md @@ -35,19 +35,19 @@ enum TestEnum { } ``` Is expanded to: -```swift +```diff enum TestEnum { case a(val1: String, val2: Int) case b case testCase(testValue: String) - var caseName: String { - switch self { - case .a: "a" - case .b: "b" - case .testCase: "testCase" - } - } ++ var caseName: String { ++ switch self { ++ case .a: "a" ++ case .b: "b" ++ case .testCase: "testCase" ++ } ++ } } ``` @@ -74,32 +74,32 @@ enum TestEnum { } ``` Is expanded to: -```swift +```diff enum TestEnum { case a(val1: String, val2: Int) case b case testCase(testValue: String) - var isA: Bool { - switch self { - case .a: return true - default: return false - } - } - - var isB: Bool { - switch self { - case .b: return true - default: return false - } - } - - var isTestCase: Bool { - switch self { - case .testCase: return true - default: return false - } - } ++ var isA: Bool { ++ switch self { ++ case .a: return true ++ default: return false ++ } ++ } + ++ var isB: Bool { ++ switch self { ++ case .b: return true ++ default: return false ++ } ++ } + ++ var isTestCase: Bool { ++ switch self { ++ case .testCase: return true ++ default: return false ++ } ++ } } ``` @@ -127,17 +127,17 @@ enum TestEnum { } ``` Is expanded to: -```swift +```diff enum TestEnum { case a(val1: String, val2: Int) case b case testCase(testValue: String) - enum Copy { - case a(val1: String, val2: Int) - case b - case testCase(testValue: String) - } ++ enum Copy { ++ case a(val1: String, val2: Int) ++ case b ++ case testCase(testValue: String) ++ } } ``` @@ -167,29 +167,29 @@ enum TestEnum { } ``` Is expanded to: -```swift +```diff enum TestEnum { case a(val1: String, Int) case b case testCase(testValue: String) - func getA() -> (val1: String, param2: Int)? { - switch self { - case let .a(val1, param2): - return (val1, param2) - default: - return nil - } - } - - func getTestCase() -> (String)? { - switch self { - case let .testCase(testValue): - return (testValue) - default: - return nil - } - } ++ func getA() -> (val1: String, param2: Int)? { ++ switch self { ++ case let .a(val1, param2): ++ return (val1, param2) ++ default: ++ return nil ++ } ++ } + ++ func getTestCase() -> (String)? { ++ switch self { ++ case let .testCase(testValue): ++ return (testValue) ++ default: ++ return nil ++ } ++ } } ```