You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of #13046 - linyihai:cargo-add-public, r=epage
Add `--public` for `cargo add`
## What does this PR try to resolve?
Complete #13037
This PR want to add `--public/--no public` flag for `cargo add`
Note: this assumes we'll remove workspace inheritance support for `public` as it sounds like we'll be reverting it rust-lang/rust#44663 (comment). If we decide to keep workspace inheritance, we'll need to come back and update this.
## How should we test and review this PR?
Most of Code were reference `cargo add --optional`, So can reviewed the new code based on the part of `optional` code.
The new testcases were origin from the `cargo add --optional` part.
- `public` testcase:there is no dependencies and will be add `public` dependencies.
- `no_public` testcase: there is no dependencies and will be add `no_public` dependencies.
- `overwrite_public` testcase: the dependencies already exists but will be overwrite with `public`.
- `overwrite_no_public` testcase: the dependencies already exists but will be overwrite with `no_public`.
- `overwrite_public_with_no_public` testcase: the dependencies already marked as `no_public` and will be overwrite with `public`.
- `overwrite_no_public_with_public` testcase: the dependencies already marked as `public` and will be overwrite with `no_public`.
0 commit comments