Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix feature conflicts v2 #253

Closed
wants to merge 10 commits into from
Closed

Fix feature conflicts v2 #253

wants to merge 10 commits into from

Conversation

marioortizmanero
Copy link
Collaborator

@marioortizmanero marioortizmanero commented Sep 19, 2021

Description

This supersedes #222, which is now kinda outdated.

In this attempt I'm trying to follow what the https://github.com/bodil/im-rs crate did. We can just have two crates; the main one for async, and a separate one for sync. We can keep using maybe_async in theory. This is unfortunately a bit confusing but it's the only way to do it. I'm working on a blog post with research about the whole async & sync stuff and I'll post it before this PR is merged to give more context and a full explanation of how it works.

Motivation and Context

This closes #221

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)
  • This change requires a documentation update

How Has This Been Tested?

An empty project with this Cargo.toml will fail:

[package]
name = "conflict"
version = "0.1.0"
edition = "2018"

[dependencies]
# Method number one
rspotify = { git = "https://github.com/ramsayleung/rspotify.git", branch = "master", features = ["client-reqwest", "client-ureq"]}

# Method number two
# rspotify-sync = { git = "https://github.com/ramsayleung/rspotify.git", branch = "fix-conflicts", features = ["client-reqwest", "client-ureq"] }
# rspotify-async = { git = "https://github.com/ramsayleung/rspotify.git", branch = "fix-conflicts", features = ["client-reqwest", "client-ureq"] }

But with this it will work:

[package]
name = "conflict"
version = "0.1.0"
edition = "2018"

[dependencies]
# Method number one
# rspotify = { git = "https://github.com/ramsayleung/rspotify.git", branch = "master", features = ["client-reqwest", "client-ureq"]}

# Method number two
rspotify-sync = { git = "https://github.com/ramsayleung/rspotify.git", branch = "fix-conflicts-2", features = ["client-ureq"] }
rspotify-async = { git = "https://github.com/ramsayleung/rspotify.git", branch = "fix-conflicts-2", features = ["client-reqwest"] }

@marioortizmanero marioortizmanero changed the base branch from master to fix-token-read September 19, 2021 19:16
@marioortizmanero marioortizmanero marked this pull request as draft September 19, 2021 19:17
Base automatically changed from fix-token-read to master September 20, 2021 12:06
@marioortizmanero
Copy link
Collaborator Author

marioortizmanero commented Sep 21, 2021

Nah, I haven't managed to get this working either... Even though there are two separate crates, a project with both rspotify-async and rspotify-sync will fail to compile. Even with different rev values (meaning that the crates shouldn't really be merged, because they are from different sources).

@marioortizmanero marioortizmanero deleted the fix-conflicts-2 branch September 21, 2021 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Avoiding conflicting features; allow multiple HTTP clients at once
1 participant