You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-1Lines changed: 26 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -574,7 +574,7 @@ struct Student: Codable {
574
574
var age: Int
575
575
var hasPet: Bool
576
576
577
-
private CodingKeys: Int, CodingKey {
577
+
private enum CodingKeys: Int, CodingKey {
578
578
case name = 0
579
579
case age = 1
580
580
case hasPet = 2
@@ -584,6 +584,31 @@ struct Student: Codable {
584
584
585
585
> Using integer coding keys has the added benefit of better encoder/decoder performance. By explicitly indicating the field index, you let the decoder skip the functionality of matching coding keys string values to headers.
586
586
587
+
To generate type-safe name header rows you can use an enum with `String` rawValues.
0 commit comments