-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Some tiny refactors around ops::cargo_compile
#11243
Conversation
r? @epage (rust-highfive has picked a reviewer for you, use r? to override) |
/// Generally, it represents the combination of all `-p` flag. When working within | ||
/// a workspace, `--exclude` and `--workspace` flags also contribute to it. | ||
#[derive(PartialEq, Eq, Debug)] | ||
pub enum Packages { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Side note: long term, I wonder where this should belong as this seems like a more fundamental CLI package selection struct that is useful outside of compilation.
For example, clap-cargo
tries to imitate this for general use. cargo-release
is at least one program that uses that logic. cargo-upgrade
had another implementation of it until we switched to oly operating on the workspace.
Being buried in cargo_compile
makes this less discoverable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fully agree. That's why even I hate the lost of git history so much but still did this 🫠
286c5ec
to
886c9d2
Compare
@bors r+ |
☀️ Test successful - checks-actions |
6 commits in b332991a57c9d055f1864de1eed93e2178d49440..3ff044334f0567ce1481c78603aeee7211b91623 2022-10-13 22:05:28 +0000 to 2022-10-17 20:25:00 +0000 - Some tiny refactors around `ops::cargo_compile` (rust-lang/cargo#11243) - Polish docs for module `build_context` (rust-lang/cargo#11241) - Remove sparse+ prefix for index.crates.io (rust-lang/cargo#11247) - docs(add): Add missing flags to reference (rust-lang/cargo#11240) - Document `cargo remove` (rust-lang/cargo#11227) - fix: Update help headings to match clap (rust-lang/cargo#11239)
Update cargo 6 commits in b332991a57c9d055f1864de1eed93e2178d49440..3ff044334f0567ce1481c78603aeee7211b91623 2022-10-13 22:05:28 +0000 to 2022-10-17 20:25:00 +0000 - Some tiny refactors around `ops::cargo_compile` (rust-lang/cargo#11243) - Polish docs for module `build_context` (rust-lang/cargo#11241) - Remove sparse+ prefix for index.crates.io (rust-lang/cargo#11247) - docs(add): Add missing flags to reference (rust-lang/cargo#11240) - Document `cargo remove` (rust-lang/cargo#11227) - fix: Update help headings to match clap (rust-lang/cargo#11239)
refactor: mod.rs over "name".rs for consistency See #11243 (comment)
What does this PR try to resolve?
Some tiny refactors I found during polishing documentations.
CompileFilter
andPackages
fromops::cargo_compile
to their own modules.FilterRule::try_collect
as its intent is not clear, and we don't need this indirection.CompileOptions::local_rustdoc_args
, which is obsolete since 1ef954e.How should we test and review this PR?
This shouldn't include any functional change.
Better to review it commit by commit.
Additional information
Moving code back and forth is indeed bad for git history tracking, but it seems better for me to make boundaries on types with different purposes. The lines of code of
cargo_compile.rs
is also reduced from 1977 to 1460, which is nicer to read.