main
Matthew Butterick 6 years ago
parent f8bb9db270
commit 24f05f066e

@ -56,11 +56,7 @@ https://github.com/mbutterick/restructure/blob/master/src/VersionedStruct.coffee
[(? x:versioned-struct?) (send field-object decode port parent)]
[_ (parse-fields port res field-object)]))
(define/override (pre-encode val)
(cond
[(and (not (dict-has-key? val x:version-key)) (dict-has-key? val 'version))
(dict-set val x:version-key (dict-ref val 'version))]
[else val]))
(define/override (pre-encode val) val)
(define/override (encode field-data port [parent-arg #f])
(unless (dict? field-data)

Loading…
Cancel
Save