Skip to content

Conversation

@MathiasKoch
Copy link
Collaborator

  • Add a to_slice function when serializing, that allows serialization into an external buffer, eliminating the need for an additional copy in some cases.
  • Change to_vec to make use of above introduced to_slice
  • Change to_string to make use of to_vec with an additional utf8 check

Fixes #35

@MathiasKoch
Copy link
Collaborator Author

@japaric

Copy link
Member

@eldruin eldruin left a comment

Choose a reason for hiding this comment

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

Other than the nitpick about the variable name, looks good to me, thanks!

@eldruin
Copy link
Member

eldruin commented Dec 10, 2020

Also, could you add an entry to the changelog for this?

@eldruin eldruin mentioned this pull request Dec 10, 2020
@eldruin
Copy link
Member

eldruin commented Dec 10, 2020

Also, how does this differ from #27 ?

@MathiasKoch
Copy link
Collaborator Author

@eldruin I think you might be right.

It looks like they add exactly the same functionality. So i think it is mostly a question of which approach do you like better?

@eldruin
Copy link
Member

eldruin commented Dec 11, 2020

I think this version is simpler so let's merge this one and close #27

@MathiasKoch MathiasKoch merged commit f55f699 into rust-embedded-community:master Dec 11, 2020
@MathiasKoch MathiasKoch deleted the enhancement/serialize-external-buffer branch December 11, 2020 08:22
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.

Serialize into externally allocated buffer

2 participants