mirror of
https://github.com/ramsayleung/rspotify.git
synced 2026-04-25 23:45:52 +03:00
[PR #364] Added a builder like struct for the search function (Related with issue ) #415
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#415
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?
📋 Pull Request Information
Original PR: https://github.com/ramsayleung/rspotify/pull/364
Author: @GartoxFR
Created: 10/16/2022
Status: 🔄 Open
Base:
master← Head:type-safe-search📝 Commits (9)
82878edAdded a builder like struct for the search function7995a07New type safe system with traits320d0f5Revert "New type safe system with traits"5b5e60dFixed comments :87c9c2dSearchQuery :92ae1a4Removed useless example6044d8fFix english mistakes04e4f8aChanged "any" query to append when used multiple times3462c77Fix missing import in doc📊 Changes
5 files changed (+186 additions, -6 deletions)
View changed files
📝
rspotify-model/src/search.rs(+18 -0)📝
src/clients/base.rs(+4 -3)📝
src/lib.rs(+1 -0)➕
src/search/mod.rs(+152 -0)📝
tests/test_with_oauth.rs(+11 -3)📄 Description
Description
These changes add a struct to build well formatted query to pass to the search method (fixes #354).
These are not breaking changes as you can still pass a simple String to the method.
It can still be improve as it doesn't prevent users to pass wrong filter with wrong SearchType (give a track title to search an album for example, which is not supporte by Spotify API).
Motivation and Context
Make writing searches easier
Dependencies
Adding strum to the main project
Type of change
Please delete options that are not relevant.
How has this been tested?
I've modified one test case to use the struct instead of a basic &str. As the old test still passes, these changes are non breaking.
I also wrote a simple example which printed the String generated by the struct to verify that it was right with its inputs. This file is included in this PR but will probably be removed if it is accepted.
Please also list any relevant details for your test configuration
Is this change properly documented?
Please make sure you've properly documented the changes you're making.
Don't forget to add an entry to the CHANGELOG if necessary (new features, breaking changes, relevant internal improvements).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.