simplify Theme.fromName to silence linter warning

This commit is contained in:
Sixten Otto
2023-02-17 12:29:35 -07:00
parent 8156328cf6
commit a166dc0d58

View File

@ -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 })
}
}