Move argument normalization into settings construction (#3103)

## Summary

No behavior changes, but the idea here is that we move the argument
normalization code (e.g., create an `Upgrade` struct from `--upgrade`
and `--upgrade-package`) into the `settings.rs` file, where we build the
common settings structs.

This reduces a lot of the logic and duplication across commands in
`main.rs`.
This commit is contained in:
Charlie Marsh 2024-04-19 19:45:08 -04:00 committed by GitHub
parent ac9c4e1f38
commit 4a98839c1d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 117 additions and 202 deletions

View file

@ -23,7 +23,7 @@ pub struct SourceTreeResolver<'a, Context: BuildContext + Send + Sync> {
/// The requirements for the project.
source_trees: Vec<PathBuf>,
/// The extras to include when resolving requirements.
extras: &'a ExtrasSpecification<'a>,
extras: &'a ExtrasSpecification,
/// The hash policy to enforce.
hasher: &'a HashStrategy,
/// The in-memory index for resolving dependencies.
@ -36,7 +36,7 @@ impl<'a, Context: BuildContext + Send + Sync> SourceTreeResolver<'a, Context> {
/// Instantiate a new [`SourceTreeResolver`] for a given set of `source_trees`.
pub fn new(
source_trees: Vec<PathBuf>,
extras: &'a ExtrasSpecification<'a>,
extras: &'a ExtrasSpecification,
hasher: &'a HashStrategy,
context: &'a Context,
client: &'a RegistryClient,