Cargo insists: unexpected argument '--all-features' found

I am a little lost. Trying to add rumqttc with cargo add rumqttc --all-features
and get error: unexpected argument '--all-features' found

I can't find any information about '--all-features' being removed from cargo, but cargo add --help doesn't mention it either.. Any ideas what i am missing?

I don't think this was ever supported. Other commands like cargo build and cargo run support --all-features, but adding a dependency with all features enabled in your manifest is something I haven't seen yet. Also, I don't believe you want to do that, because from a quick glance at rumqttc, it looks like it has features that are incompatible with each other, namely use-rustls and use-native-tls. You can explicitly define which features Cargo should add with the --features flag, like:

cargo add rumqttc --features=websocket,url

i was just following the Readme on

But I agree. Your answer makes a lot more sense. Thanks

If you have time, you should submit a GIthub issue or a pull request fixing the documentation. Then, nobody else will have the same issue.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.