Avoid accepting references to Copy
types
#330
Merged
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.
Description
search
acceptsOption<IncludeExternal>
instead ofOption<&IncludeExternal>
featured_playlists
acceptsOption<chrono::DateTime<chrono::Utc>>
instead ofOption<&chrono::DateTime<chrono::Utc>>
current_user_top_artists[_manual]
andcurrent_user_top_tracks[_manual]
acceptOption<TimeRange>
instead ofOption<&TimeRange>
I didn’t do the same for
Market
parameters because they’re notCopy
(although they could be) — I’ll leave it to a separate PR.Motivation and Context
Accepting a reference to a
Copy
type is usually counterproductive, since you can just take it by value. For most types this makes the size of the parameters smaller, for theOption<chrono::DateTime<chrono::Utc>>
it increases it from 8 bytes to 16 bytes but I think that’s acceptable.Dependencies
None.
Type of change
Please delete options that are not relevant.
How has this been tested?
cargo test --features env-file