Skip to content

Commit 9fb428b

Browse files
committed
refactor(fix): Move workspace loading closer to use
1 parent 2f4d3df commit 9fb428b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/bin/cargo/commands/fix.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ pub fn cli() -> Command {
6060
}
6161

6262
pub fn exec(gctx: &mut GlobalContext, args: &ArgMatches) -> CliResult {
63-
let ws = args.workspace(gctx)?;
6463
// This is a legacy behavior that causes `cargo fix` to pass `--test`.
6564
let test = matches!(
6665
args.get_one::<String>("profile").map(String::as_str),
@@ -70,6 +69,7 @@ pub fn exec(gctx: &mut GlobalContext, args: &ArgMatches) -> CliResult {
7069

7170
// Unlike other commands default `cargo fix` to all targets to fix as much
7271
// code as we can.
72+
let ws = args.workspace(gctx)?;
7373
let mut opts = args.compile_options(gctx, mode, Some(&ws), ProfileChecking::LegacyTestOnly)?;
7474

7575
if !opts.filter.is_specific() {

0 commit comments

Comments
 (0)