From ca699d264af16f520b66ae664c920e653c709a68 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Thu, 11 Apr 2024 20:47:24 -0500 Subject: [PATCH] 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. --- src/bin/cargo/commands/fix.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bin/cargo/commands/fix.rs b/src/bin/cargo/commands/fix.rs index 74c341c73..f9651e7fe 100644 --- a/src/bin/cargo/commands/fix.rs +++ b/src/bin/cargo/commands/fix.rs @@ -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() {