mirror of
https://github.com/ramsayleung/rspotify.git
synced 2026-04-26 16:05:53 +03:00
[GH-ISSUE #33] Create "default" values/Builder pattern for some structs #11
Labels
No labels
Stale
bug
discussion
enhancement
good first issue
good first issue
help wanted
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/rspotify#11
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mrcosta on GitHub (Feb 13, 2019).
Original GitHub issue: https://github.com/ramsayleung/rspotify/issues/33
Hello,
I'm unit testing my code and in order to do it I need to create a simplified version of
SimplifiedAlbum(I understand the irony here of simplified version of something already simplified ) since I need justexternal_urls,id,name.An example of one that I'm creating:
In the end, I would like some flexibility to create a simplified version of this struct with less code. I think I will try to work in this change this weekend, but just in case if someone also wants to do it...
@ramsayleung commented on GitHub (Feb 14, 2019):
It sounds great :)
@marioortizmanero commented on GitHub (Feb 25, 2021):
I'm all in for
Defaultimplementations. The example you provided can be replaced by:It's a not-so-known trick that can come in very handy. Al we would need to do is add
#[derive(Default)]to the models, and review non-trivial cases manually. A builder pattern for every model could be quite an overhead and a pain to maintain.