Skip to content

Commit

Permalink
fix emptyAsNil
Browse files Browse the repository at this point in the history
  • Loading branch information
nixzhu committed Dec 2, 2023
1 parent b2a9308 commit fd86751
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/AnandaMacros/AnandaInitMacro.swift
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ extension TypeSyntax {
case "Date":
return "\(json).date"
default:
return "\(json).emptyAsNil?.map { .init(json: $0) }"
return "\(json).emptyAsNil.map { .init(json: $0) }"
}
}

Expand Down
2 changes: 1 addition & 1 deletion Tests/AnandaTests/MacroTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ final class MacroTests: XCTestCase {
$0.bool()
}
self.c1 = .init(json: json["c1"])
self.c2 = json["c2"].emptyAsNil?.map {
self.c2 = json["c2"].emptyAsNil.map {
.init(json: $0)
}
self.c3 = json["c3"].array().map {
Expand Down

0 comments on commit fd86751

Please sign in to comment.