bson-rust icon indicating copy to clipboard operation
bson-rust copied to clipboard

RUST-1773 Merge duplicate extjson map parsing between OwnedOrBorrowedRawBsonVisitor and SeededVisitor

Open abr-egn opened this issue 1 year ago • 0 comments

RUST-1773

This puts responsibility for turning a Serde map into bson values squarely on OwnedOrBorrowedRawBsonVisitor; SeededVisitor's job is now to efficiently buffer those values.

In my plan for the 🎆Glorious Future🎆, OwnedOrBorrowedRawBsonVisitor will also be taking over for the other places that parse extjson (BsonVisitor, TryFrom<serde_json::Value>, crate::extjson::models) and will necessarily be getting more liberal in the forms it accepts, so this means that doesn't need to be mirrored in SeededVisitor as well.

With this, I think the separation of logic is clear enough that there's no need to further merge; the reasoning from your original work on why that would involve quite a bit of complication is still very valid.

abr-egn avatar Jul 02 '24 20:07 abr-egn