refactor(fix): Move workspace loading closer to use

This commit is contained in:
Ed Page 2024-04-11 20:45:57 -05:00
parent 2f4d3df54d
commit 9fb428bd05
1 changed files with 1 additions and 1 deletions

View File

@ -60,7 +60,6 @@ pub fn cli() -> Command {
}
pub fn exec(gctx: &mut GlobalContext, args: &ArgMatches) -> CliResult {
let ws = args.workspace(gctx)?;
// This is a legacy behavior that causes `cargo fix` to pass `--test`.
let test = matches!(
args.get_one::<String>("profile").map(String::as_str),
@ -70,6 +69,7 @@ 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 mut opts = args.compile_options(gctx, mode, Some(&ws), ProfileChecking::LegacyTestOnly)?;
if !opts.filter.is_specific() {