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

Copy crate name, version with feature flags? #2407

Open
ssiyad opened this issue Feb 3, 2024 · 2 comments
Open

Copy crate name, version with feature flags? #2407

ssiyad opened this issue Feb 3, 2024 · 2 comments

Comments

@ssiyad
Copy link

ssiyad commented Feb 3, 2024

In docs.rs, we can copy a crate's name and version to be pasted into Cargo.toml. Is there any way to include feature flags into this?

tower-http = "0.5.1" -> tower-http = { version = "0.5.1", features = ["trace"] }

image
@syphar
Copy link
Member

syphar commented Feb 4, 2024

Hi,

thank you for the idea!

Could you elaborate on how you imagine this to look like?
How would we know which features to add here?

Where do you see the advantage over cargo add CRATE VERSION -F feature_name? (where crate and version could be pasted from our output).

@ssiyad
Copy link
Author

ssiyad commented Feb 6, 2024

Assume, in /features page (Feature flags), we have checkbox beside every feature. We can select features we want. We can then use the Copy button.
Screenshot 2024-02-07 at 12 03 35 AM

I think this is better than cargo add because we can interactively select features and also skip the cargo add step entirely.

It might not be a good idea to include all available features in header dropdown. I believe we can add features from full but I have no idea how they work :)

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

No branches or pull requests

2 participants