[PR #128] [MERGED] Polish Rspotify #261

Closed
opened 2026-02-27 20:24:00 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ramsayleung/rspotify/pull/128
Author: @ramsayleung
Created: 9/19/2020
Status: Merged
Merged: 10/27/2020
Merged by: @ramsayleung

Base: masterHead: ramsay_clean_up_rspotify


📝 Commits (10+)

  • dfaa9d6 clean up util.rs remove functions: convert_map_to_string and convert_map_to_string
  • bc979a7 clean up util.rs remove functions: convert_map_to_string and convert_map_to_string
  • 0e63c1a Merge branch 'ramsay_clean_up_rspotify' of github.com:ramsayleung/rspotify into ramsay_clean_up_rspotify
  • cb162a9 clean up blocking/utils.rs, it's painful to maintain two sets of code which are
  • 6d4c0a8 replace explict Vec or Array to impl IntoIterator<Item=&str> in async module.
  • 66a2e5d replace impl IntoIterator<Item=&str> to impl IntoIterator<Item=&String> to keep backward compatibility
  • 348aa44 replace Vec or Array to impl IntoIterator<Item = String> in blocking module.
  • c61c582 fix failed tests and checks.
  • 3c6b5ba Update CHANGELOG.md.
  • 5a6a83d Change endpoints with parameter from Vec<String> to impl IntoIterator<Item = &str>.

📊 Changes

21 files changed (+997 additions, -1365 deletions)

View changed files

📝 CHANGELOG.md (+35 -1)
📝 Cargo.toml (+1 -0)
📝 examples/ureq/search.rs (+1 -1)
📝 examples/with_refresh_token.rs (+5 -5)
📝 src/client.rs (+148 -119)
📝 src/lib.rs (+0 -1)
📝 src/model/album.rs (+2 -2)
📝 src/model/artist.rs (+1 -1)
📝 src/model/context.rs (+2 -2)
📝 src/model/device.rs (+1 -1)
src/model/enums/country.rs (+518 -0)
src/model/enums/misc.rs (+96 -0)
src/model/enums/mod.rs (+10 -0)
src/model/enums/types.rs (+120 -0)
📝 src/model/mod.rs (+7 -0)
📝 src/model/playlist.rs (+1 -1)
📝 src/model/track.rs (+1 -1)
📝 src/model/user.rs (+2 -2)
src/senum.rs (+0 -1178)
📝 tests/test_with_credential.rs (+11 -11)

...and 1 more files

📄 Description

Clean up Rspotify, take some points of https://github.com/ramsayleung/rspotify/issues/127 into consideration.

  • remove convert_map_to_string and convert_string_to_map in util.rs, replaced them with Reqwest's query method and Url struct.
  • Many functions like Spotify::tracks take in a Vec<&str>/Vec/&[String]/&[&str], when they should take in an impl IntoIterator<Item = &str>.
  • Split single senum.rs file into a module named enums and move it into model module.
  • reexport struct in model module to allow users to write rspotify::model::FullAlbum instead of the overly verbose rspotify::model::album::FullAlbum.
  • Rename CurrentlyPlaybackContext to CurrentPlaybackContext.
  • Change release_date_precision to enum.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ramsayleung/rspotify/pull/128 **Author:** [@ramsayleung](https://github.com/ramsayleung) **Created:** 9/19/2020 **Status:** ✅ Merged **Merged:** 10/27/2020 **Merged by:** [@ramsayleung](https://github.com/ramsayleung) **Base:** `master` ← **Head:** `ramsay_clean_up_rspotify` --- ### 📝 Commits (10+) - [`dfaa9d6`](https://github.com/ramsayleung/rspotify/commit/dfaa9d6159a40195793f144dd5132c2a1795c161) clean up util.rs remove functions: convert_map_to_string and convert_map_to_string - [`bc979a7`](https://github.com/ramsayleung/rspotify/commit/bc979a774bcdb7795841abfb87a137d41601eb75) clean up util.rs remove functions: convert_map_to_string and convert_map_to_string - [`0e63c1a`](https://github.com/ramsayleung/rspotify/commit/0e63c1adc660c742af655372c6b1487095849525) Merge branch 'ramsay_clean_up_rspotify' of github.com:ramsayleung/rspotify into ramsay_clean_up_rspotify - [`cb162a9`](https://github.com/ramsayleung/rspotify/commit/cb162a9820e358968457472cdbb45ad352c43afd) clean up blocking/utils.rs, it's painful to maintain two sets of code which are - [`6d4c0a8`](https://github.com/ramsayleung/rspotify/commit/6d4c0a859438189337a57045377abca823e31a6b) replace explict Vec or Array to impl IntoIterator<Item=&str> in async module. - [`66a2e5d`](https://github.com/ramsayleung/rspotify/commit/66a2e5dfd3b7234664e9effd7555e50045e9b0b5) replace impl IntoIterator<Item=&str> to impl IntoIterator<Item=&String> to keep backward compatibility - [`348aa44`](https://github.com/ramsayleung/rspotify/commit/348aa44b424c7965f27c9df033bb3f3d420ec173) replace Vec or Array to impl IntoIterator<Item = String> in blocking module. - [`c61c582`](https://github.com/ramsayleung/rspotify/commit/c61c58216021f9bb2c8f9e00b3d7ad28e37c4f0f) fix failed tests and checks. - [`3c6b5ba`](https://github.com/ramsayleung/rspotify/commit/3c6b5baa04730456f73f51703c61b8a31f0e85af) Update CHANGELOG.md. - [`5a6a83d`](https://github.com/ramsayleung/rspotify/commit/5a6a83d0540bbfbfa9d24f72f5f037e7c2e60795) Change endpoints with parameter from `Vec<String>` to `impl IntoIterator<Item = &str>`. ### 📊 Changes **21 files changed** (+997 additions, -1365 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+35 -1) 📝 `Cargo.toml` (+1 -0) 📝 `examples/ureq/search.rs` (+1 -1) 📝 `examples/with_refresh_token.rs` (+5 -5) 📝 `src/client.rs` (+148 -119) 📝 `src/lib.rs` (+0 -1) 📝 `src/model/album.rs` (+2 -2) 📝 `src/model/artist.rs` (+1 -1) 📝 `src/model/context.rs` (+2 -2) 📝 `src/model/device.rs` (+1 -1) ➕ `src/model/enums/country.rs` (+518 -0) ➕ `src/model/enums/misc.rs` (+96 -0) ➕ `src/model/enums/mod.rs` (+10 -0) ➕ `src/model/enums/types.rs` (+120 -0) 📝 `src/model/mod.rs` (+7 -0) 📝 `src/model/playlist.rs` (+1 -1) 📝 `src/model/track.rs` (+1 -1) 📝 `src/model/user.rs` (+2 -2) ➖ `src/senum.rs` (+0 -1178) 📝 `tests/test_with_credential.rs` (+11 -11) _...and 1 more files_ </details> ### 📄 Description Clean up Rspotify, take some points of https://github.com/ramsayleung/rspotify/issues/127 into consideration. + [x] ~~remove convert_map_to_string and convert_string_to_map in `util.rs`, replaced them with `Reqwest's` `query` method and `Url` struct.~~ + [x] Many functions like Spotify::tracks take in a Vec<&str>/Vec<String>/&[String]/&[&str], when they should take in an impl IntoIterator<Item = &str>. + [x] Split single `senum.rs` file into a module named `enums` and move it into `model` module. + [x] reexport struct in `model` module to allow users to write `rspotify::model::FullAlbum` instead of the overly verbose `rspotify::model::album::FullAlbum`. + [x] Rename CurrentlyPlaybackContext to CurrentPlaybackContext. + [x] Change release_date_precision to enum. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 20:24:00 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/rspotify#261
No description provided.