mirror of
https://github.com/ramsayleung/rspotify.git
synced 2026-04-26 07:55:55 +03:00
[PR #114] [MERGED] Fix tests #252
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#252
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/114
Author: @marioortizmanero
Created: 8/16/2020
Status: ✅ Merged
Merged: 8/16/2020
Merged by: @ramsayleung
Base:
master← Head:fix-tests📝 Commits (3)
9859fdeFix tests02a1bf2cargo fmt4197c41Also implement for blocking module📊 Changes
2 files changed (+18 additions, -16 deletions)
View changed files
📝
src/blocking/client.rs(+9 -8)📝
src/client.rs(+9 -8)📄 Description
I think the issue with the tests is that Rspotify had a bug for multithreaded requests, which is needed for Rust tests. The
reqwestclient (CLIENT) was a global with no thread safety at all (for some reason Rust didn't detect that). Thus, there are two possible solutions:Arc<Mutex<T>>so that it's thread-safe. But global state is usually a bad idea IMO.Spotifystruct itself. This means that it can no longer deriveSerializeandDeserialize, but I don't see why these were needed anyway, and it makes sense to me to have a client for eachSpotifyobject.By the way, I would like to know whyOkay I've just seen this commitSerializeandDeserializeare needed for structs such asSpotifyandApiError. Shouldn't these be cleaned up?github.com/ramsayleung/rspotify@b7b7c6f8b9This should close #95.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.