Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

RUST-1512 Provide a method to append a borrowed value #463

Merged
merged 4 commits into from
Mar 18, 2024

Conversation

abr-egn
Copy link
Contributor

@abr-egn abr-egn commented Mar 18, 2024

RUST-1512

This adds RawDocumentBuf::append_ref, providing a method equivalent to append for borrowed data. This can be useful for avoiding the need for intermediate buffers when the source data is borrowed.

@abr-egn abr-egn requested a review from isabelatkinson March 18, 2024 16:54
Copy link
Contributor

@isabelatkinson isabelatkinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! could we combine append and append_ref somehow in a future major version release?

@abr-egn abr-egn merged commit 546fbea into mongodb:main Mar 18, 2024
11 checks passed
@abr-egn
Copy link
Contributor Author

abr-egn commented Mar 18, 2024

nice! could we combine append and append_ref somehow in a future major version release?

I'm not sure, actually - what we want is basically anything that can convert into either owned or borrowed bson, and I don't know if that can be expressed reasonably in the Rust type system. Filed RUST-1887 to track that.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants