fix: handle Option<NaiveDate> when serializing end_date#70
Open
MackDing wants to merge 1 commit intoPolymarket:mainfrom
Open
fix: handle Option<NaiveDate> when serializing end_date#70MackDing wants to merge 1 commit intoPolymarket:mainfrom
MackDing wants to merge 1 commit intoPolymarket:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #65
p.end_dateisOption<NaiveDate>so calling.to_string()directly fails to compile on stable Rust.Verified with
cargo check(0 errors).Note
Low Risk
Small, localized change to JSON formatting for a single field; main impact is that missing
end_datenow serializes asnullinstead of failing to compile.Overview
Fixes JSON serialization for
Position.end_dateinprint_positionsby converting it withOption::mapinstead of calling.to_string()directly.This makes
end_dateemit as either a string date ornullin the JSON output and restores compilation on stable Rust whenend_dateisOption<NaiveDate>.Reviewed by Cursor Bugbot for commit 85494cc. Bugbot is set up for automated code reviews on this repo. Configure here.