mirror of
https://github.com/logos-storage/nim-serde.git
synced 2026-05-18 17:29:31 +00:00
Remove useless statements
This commit is contained in:
parent
1435816dba
commit
3f07ed7169
@ -202,9 +202,6 @@ proc fromJson*[T: ref object or object](_: type T, json: JsonNode): ?!T =
|
||||
of Strict:
|
||||
if opts.key notin json:
|
||||
return failure newSerdeError("object field missing in json: " & opts.key)
|
||||
elif opts.ignore:
|
||||
# unable to figure out a way to make this a compile time check
|
||||
discard
|
||||
of OptIn:
|
||||
if not hasDeserializePragma:
|
||||
skip = true
|
||||
@ -215,8 +212,6 @@ proc fromJson*[T: ref object or object](_: type T, json: JsonNode): ?!T =
|
||||
of OptOut:
|
||||
if opts.ignore:
|
||||
skip = true
|
||||
elif hasDeserializePragma and opts.key == name:
|
||||
discard
|
||||
|
||||
if not skip:
|
||||
if isOptionalValue:
|
||||
|
||||
@ -99,12 +99,6 @@ proc `%`*[T: object or ref object](obj: T): JsonNode =
|
||||
of OptOut:
|
||||
if opts.ignore:
|
||||
skip = true
|
||||
elif hasSerialize and opts.key == name: # all serialize params are default
|
||||
discard
|
||||
of Strict:
|
||||
if opts.ignore:
|
||||
# unable to figure out a way to make this a compile time check
|
||||
discard
|
||||
|
||||
if not skip:
|
||||
jsonObj[opts.key] = %value
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user