Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Simplify lifetimes #9

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Simplify lifetimes #9

wants to merge 2 commits into from

Conversation

Twey
Copy link

@Twey Twey commented Nov 14, 2023

Atop #8. This generalizes and simplifies the lifetimes used in the Serializer and Deserializer structs. Previous behaviour remains by instantiating R = &mut R_.

Allows external projects to plug BCS into libraries that expect a
`serde` `Serializer` or `Deserializer` implementation.
Since `&'a mut R` is `Read` (or `Write`) when `R` is
`Read` (resp. `Write`), there is no need to depend on `<R: ?Sized +
Read> &'a mut R` over just plain `<R: Read> R`.  The caller can still
instantiate `R = &'a mut R_` when a reference is desired (and indeed
this is done here for e.g. `MapDeserializer`).
Copy link
Contributor

@ma2bd ma2bd left a comment

Choose a reason for hiding this comment

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

@Twey Looks promising but it doesn't build in CI.

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.

None yet

2 participants