Init from raw lowercased
This commit is contained in:
@@ -110,7 +110,7 @@ public enum Unit: String, CaseIterable, CustomStringConvertible, Codable,
|
|||||||
|
|
||||||
public init?(rawValue: String) {
|
public init?(rawValue: String) {
|
||||||
if let unit = Unit.allCases.first(where: {
|
if let unit = Unit.allCases.first(where: {
|
||||||
$0.rawValue.lowercased() == rawValue
|
$0.rawValue.lowercased() == rawValue.lowercased()
|
||||||
}) {
|
}) {
|
||||||
self = unit
|
self = unit
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user