[PR #206] [MERGED] Pass parameters by reference and use iterators wherever possible #312

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

📋 Pull Request Information

Original PR: https://github.com/ramsayleung/rspotify/pull/206
Author: @ramsayleung
Created: 4/26/2021
Status: Merged
Merged: 4/28/2021
Merged by: @marioortizmanero

Base: masterHead: ramsay_pass_parameters_by_reference


📝 Commits (10+)

  • 5fc8c8e Pass parameter by reference instead of by value.
  • 94a792c Update CHANGELOG.md
  • 6e5206c Update tests to pass parameters by reference
  • 78962cd Replace for loop with iterator
  • 6d0ee2d Merge branch 'master' into ramsay_pass_parameters_by_reference
  • 29625fd Replace slice reference with IntoIterator
  • 1488532 Fix compilation error
  • df8d58a Update CHANGELOG.md
  • 926077c Removed useless tests and optimize code
  • 51b8b4a remove explicit type declaration

📊 Changes

4 files changed (+83 additions, -59 deletions)

View changed files

📝 CHANGELOG.md (+16 -0)
📝 src/client.rs (+44 -35)
📝 tests/test_with_credential.rs (+1 -1)
📝 tests/test_with_oauth.rs (+22 -23)

📄 Description

Description

Currently the parameters mostly are passed by value, which means the compiler will Copy the parameter when passes them into a method, it's a little inefficient, then pass them by reference instead.

Using iterators wherever possible, since it's more atomic and rusty.

Fixed #127

Motivation and Context

Improve the efficiency of this library.

Dependencies

List any dependencies that are required for this change.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • All existing tests pass.
  • Add some tests for iterator

🔄 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/206 **Author:** [@ramsayleung](https://github.com/ramsayleung) **Created:** 4/26/2021 **Status:** ✅ Merged **Merged:** 4/28/2021 **Merged by:** [@marioortizmanero](https://github.com/marioortizmanero) **Base:** `master` ← **Head:** `ramsay_pass_parameters_by_reference` --- ### 📝 Commits (10+) - [`5fc8c8e`](https://github.com/ramsayleung/rspotify/commit/5fc8c8e374d50061f2ab91d54f76c7b0c18bc486) Pass parameter by reference instead of by value. - [`94a792c`](https://github.com/ramsayleung/rspotify/commit/94a792cfec8804805a7cd748bd42f261fd951f4c) Update CHANGELOG.md - [`6e5206c`](https://github.com/ramsayleung/rspotify/commit/6e5206c74a4d78c4eb89535ad1fa3df012b89ea6) Update tests to pass parameters by reference - [`78962cd`](https://github.com/ramsayleung/rspotify/commit/78962cd655958070f3d22c9c4a4bbe1812c51065) Replace for loop with iterator - [`6d0ee2d`](https://github.com/ramsayleung/rspotify/commit/6d0ee2d1abe830088fbea9736e8cdcdca5189006) Merge branch 'master' into ramsay_pass_parameters_by_reference - [`29625fd`](https://github.com/ramsayleung/rspotify/commit/29625fd70d987dacf1b982b6332aa907167f0ddb) Replace slice reference with IntoIterator - [`1488532`](https://github.com/ramsayleung/rspotify/commit/1488532825d88d279367fc105c09b338da44bdab) Fix compilation error - [`df8d58a`](https://github.com/ramsayleung/rspotify/commit/df8d58ada15e77e1612872c1dc63db011a653e37) Update CHANGELOG.md - [`926077c`](https://github.com/ramsayleung/rspotify/commit/926077c6ec85b17081cfaf1dcd083585025f3f74) Removed useless tests and optimize code - [`51b8b4a`](https://github.com/ramsayleung/rspotify/commit/51b8b4a0df6ec983e63a22a84696a33d39562a46) remove explicit type declaration ### 📊 Changes **4 files changed** (+83 additions, -59 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+16 -0) 📝 `src/client.rs` (+44 -35) 📝 `tests/test_with_credential.rs` (+1 -1) 📝 `tests/test_with_oauth.rs` (+22 -23) </details> ### 📄 Description ## Description Currently the parameters mostly are passed by value, which means the compiler will `Copy` the parameter when passes them into a method, it's a little inefficient, then pass them by reference instead. Using iterators wherever possible, since it's more atomic and rusty. Fixed #127 ## Motivation and Context Improve the efficiency of this library. ## Dependencies List any dependencies that are required for this change. ## Type of change Please delete options that are not relevant. - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [x] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [x] This change requires a documentation update ## How Has This Been Tested? - [x] All existing tests pass. - [x] Add some tests for iterator --- <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:13 +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#312
No description provided.