Skip to content

Commit f5b0fff

Browse files
committed
refactor(lock): Pull out path for reuse
1 parent 048d21d commit f5b0fff

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/cargo/ops/lockfile.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,12 @@ pub fn write_pkg_lockfile(ws: &Workspace<'_>, resolve: &mut Resolve) -> CargoRes
5353
}
5454

5555
if let Some(locked_flag) = ws.gctx().locked_flag() {
56+
let lockfile_path = lock_root.as_path_unlocked().join(LOCKFILE_NAME);
5657
anyhow::bail!(
5758
"the lock file {} needs to be updated but {} was passed to prevent this\n\
5859
help: to generate the lock file without accessing the network, \
5960
remove the {} flag and use --offline instead.",
60-
lock_root.as_path_unlocked().join(LOCKFILE_NAME).display(),
61+
lockfile_path.display(),
6162
locked_flag,
6263
locked_flag
6364
);

0 commit comments

Comments
 (0)