refactor(fix): Flatten workspace loading

This misses out on features that shouldn't be relevant to fix, like
avoid-dev-deps.

However, this prepares the way for workspace re-loading.
This commit is contained in:
Ed Page 2024-04-11 20:47:24 -05:00
parent 9fb428bd05
commit ca699d264a
1 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,6 @@
use crate::command_prelude::*;
use cargo::core::Workspace;
use cargo::ops;
pub fn cli() -> Command {
@ -69,7 +70,8 @@ pub fn exec(gctx: &mut GlobalContext, args: &ArgMatches) -> CliResult {
// Unlike other commands default `cargo fix` to all targets to fix as much
// code as we can.
let ws = args.workspace(gctx)?;
let root_manifest = args.root_manifest(gctx)?;
let ws = Workspace::new(&root_manifest, gctx)?;
let mut opts = args.compile_options(gctx, mode, Some(&ws), ProfileChecking::LegacyTestOnly)?;
if !opts.filter.is_specific() {