Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I think the issue with the tests is that Rspotify had a bug for multithreaded requests, which is needed for Rust tests. The
reqwest
client (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.Spotify
struct itself. This means that it can no longer deriveSerialize
andDeserialize
, but I don't see why these were needed anyway, and it makes sense to me to have a client for eachSpotify
object.By the way, I would like to know whyOkay I've just seen this commit b7b7c6fSerialize
andDeserialize
are needed for structs such asSpotify
andApiError
. Shouldn't these be cleaned up?This should close #95.