From a166dc0d58fa3eef5a4e0fcb59124ba91005929e Mon Sep 17 00:00:00 2001 From: Sixten Otto Date: Fri, 17 Feb 2023 12:29:35 -0700 Subject: [PATCH] simplify Theme.fromName to silence linter warning --- apple/OmnivoreKit/Sources/Views/Theme.swift | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/apple/OmnivoreKit/Sources/Views/Theme.swift b/apple/OmnivoreKit/Sources/Views/Theme.swift index ece0f55fd..c5cf66d6a 100644 --- a/apple/OmnivoreKit/Sources/Views/Theme.swift +++ b/apple/OmnivoreKit/Sources/Views/Theme.swift @@ -40,12 +40,7 @@ public enum Theme: String, CaseIterable { } public static func fromName(themeName: String) -> Theme? { - for theme in Theme.allCases { - if theme.rawValue == themeName { - return theme - } - } - return nil + Theme.allCases.first(where: { $0.rawValue == themeName }) } }