Skip to content

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
@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants