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

Return &[u8] from val trait (Fixes #165) #173

Merged
merged 1 commit into from
Jul 31, 2023

Conversation

nytzuga
Copy link
Contributor

@nytzuga nytzuga commented Jul 30, 2023

Instead of return a Vec return a reference to avoid cloning the data before returning.

Instead of return a Vec<u8> return a reference to avoid cloning the data before
returning.
@nytzuga nytzuga changed the title Draft: Return &[u8] from val trait (Fixes #165) Return &[u8] from val trait (Fixes #165) Jul 30, 2023
@nytzuga nytzuga self-assigned this Jul 31, 2023
Copy link
Collaborator

@rkuris rkuris left a comment

Choose a reason for hiding this comment

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

LGTM, we may have to revisit the lifetime of the returned data but the inferred lifetime of &self is probably sufficient here.

@nytzuga nytzuga merged commit 6b60e95 into main Jul 31, 2023
5 checks passed
@nytzuga nytzuga deleted the update-val-trait-return-reference branch July 31, 2023 19:52
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