-
Notifications
You must be signed in to change notification settings - Fork 123
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
Uri enum #414
Comments
Please follow the issue template to describe your problem with context information, it would be helpful for others to understand your issue. |
I think this is a sufficient implementation for what I am talking about (if you agree it is desirable). Although someone may have suggestions. Someone could argue that Uri should be a struct with id and type, perhaps with another type for the enum. |
I think it makes sense to me, feel free to create a PR :) |
Message to comment on stale issues. If none provided, will not mark issues stale |
Is your feature request related to a problem? Please describe.
I am making a cli for testing parts of my application and want to pass a spotify uri as an arg. A way to parse this as a valid spotify uri, then match on it, would be useful. It would also serve as a useful type for parts of my application which are generic over Album, Playlist, or Track, of which there are many.
Describe the solution you'd like
It would be convenient to have an Uri enum covering all the Id types, so we can always parse a uri, and match over the various ids.
Describe alternatives you've considered
Manually calling parse_uri and matching over the result.
Alternatively Uri could be a struct with id and type. Though I think this is maybe more cumbersome for matching.
The text was updated successfully, but these errors were encountered: