Prefer slice argument when passing in content key #165
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change probably looks a little surprising in isolation. Right now it causes an extra clone (because we were previously able to move in a vector that now has to be cloned inside the method).
Here is a super draft-y PR to help show the context of where I think it makes more sense:
https://github.com/ethereum/trin/pull/166/files#diff-fd7cee899607b5a0b4e30853e7bb9f8a191ed26926c7724f6b66d3070f62cf56R67-R72
Also, at some point, it should be possible to build the request from a slice without copying it first. It just doesn't seem like a priority now. But we might as well prepare the API to head that direction IMO. As always, open to discussion.