JSON files - missing fields
-
How to deal with fields that are in our
structbut are missing from the JSON? -
Return
Result<Error>and handle it or let itpanic!. -
Set a default value.
-
Make the value optional with
Option.
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
How to deal with fields that are in our struct but are missing from the JSON?
Return Result<Error> and handle it or let it panic!.
Set a default value.
Make the value optional with Option.