[PR #337] [MERGED] Fix double referenced types in paginated endpoints #406

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

📋 Pull Request Information

Original PR: https://github.com/ramsayleung/rspotify/pull/337
Author: @marioortizmanero
Created: 7/13/2022
Status: Merged
Merged: 10/4/2022
Merged by: @ramsayleung

Base: masterHead: fix_double_reference_pagination


📝 Commits (3)

📊 Changes

15 files changed (+106 additions, -49 deletions)

View changed files

📝 rspotify-model/src/album.rs (+2 -2)
📝 rspotify-model/src/lib.rs (+1 -1)
📝 rspotify-model/src/playlist.rs (+2 -2)
📝 rspotify-model/src/show.rs (+1 -1)
📝 src/auth_code.rs (+1 -1)
📝 src/auth_code_pkce.rs (+1 -1)
📝 src/client_creds.rs (+1 -1)
📝 src/clients/base.rs (+39 -24)
📝 src/clients/mod.rs (+2 -2)
📝 src/clients/pagination/iter.rs (+11 -0)
📝 src/clients/pagination/mod.rs (+6 -2)
📝 src/clients/pagination/stream.rs (+27 -0)
📝 src/lib.rs (+6 -6)
📝 tests/test_with_credential.rs (+4 -4)
📝 tests/test_with_oauth.rs (+2 -2)

📄 Description

Description

This removes the potential double reference to Id types (&'a Id<'_>)
which was previously required due to limitations in the async variant of
the paginate function.
Due to limitations in HRTBs (see
https://kevincox.ca/2022/04/16/rust-generic-closure-lifetimes/) it is
not possible, to write something like Req: for<'a> Fn(&'a) -> ('a + Future<...>). The sync version remains almost unchanged.

Motivation and Context

See #305

Dependencies

None

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How has this been tested?

CI passes

Is this change properly documented?

No need, it's an internal change


🔄 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/337 **Author:** [@marioortizmanero](https://github.com/marioortizmanero) **Created:** 7/13/2022 **Status:** ✅ Merged **Merged:** 10/4/2022 **Merged by:** [@ramsayleung](https://github.com/ramsayleung) **Base:** `master` ← **Head:** `fix_double_reference_pagination` --- ### 📝 Commits (3) - [`122d22e`](https://github.com/ramsayleung/rspotify/commit/122d22e94324db52337133fc3adacda3960dd688) fix double referenced types in paginated endpoints - [`081e890`](https://github.com/ramsayleung/rspotify/commit/081e8902791c6eb00206c9e25f3080318292d295) cargo fmt - [`0a3c016`](https://github.com/ramsayleung/rspotify/commit/0a3c0165387af42f8245e0b7e92bfd1cc99c42e2) fix clippy lints ### 📊 Changes **15 files changed** (+106 additions, -49 deletions) <details> <summary>View changed files</summary> 📝 `rspotify-model/src/album.rs` (+2 -2) 📝 `rspotify-model/src/lib.rs` (+1 -1) 📝 `rspotify-model/src/playlist.rs` (+2 -2) 📝 `rspotify-model/src/show.rs` (+1 -1) 📝 `src/auth_code.rs` (+1 -1) 📝 `src/auth_code_pkce.rs` (+1 -1) 📝 `src/client_creds.rs` (+1 -1) 📝 `src/clients/base.rs` (+39 -24) 📝 `src/clients/mod.rs` (+2 -2) 📝 `src/clients/pagination/iter.rs` (+11 -0) 📝 `src/clients/pagination/mod.rs` (+6 -2) 📝 `src/clients/pagination/stream.rs` (+27 -0) 📝 `src/lib.rs` (+6 -6) 📝 `tests/test_with_credential.rs` (+4 -4) 📝 `tests/test_with_oauth.rs` (+2 -2) </details> ### 📄 Description ## Description This removes the potential double reference to Id types (&'a Id<'_>) which was previously required due to limitations in the async variant of the `paginate` function. Due to limitations in HRTBs (see https://kevincox.ca/2022/04/16/rust-generic-closure-lifetimes/) it is not possible, to write something like `Req: for<'a> Fn(&'a) -> ('a + Future<...>)`. The sync version remains almost unchanged. ## Motivation and Context See #305 ## Dependencies None ## Type of change Please delete options that are not relevant. - [x] Bug fix (non-breaking change which fixes an issue) - [x] Breaking change (fix or feature that would cause existing functionality to not work as expected) ## How has this been tested? CI passes ## Is this change properly documented? No need, it's an internal change --- <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:36 +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#406
No description provided.