cargo update -w --locked
-
The
-w/--workspaceis thety key element that shall make theCargo.lockbump be as minimal as possible, much likecargo check/build/...do
-
On older Cargo, I guess you could achieve the same by using
-p your-own-package. -
When dealing with multiple workspaces:
find . -type f -name 'Cargo.lock' -print0 \ | while IFS=$'\0' read -r -d '' file; do (set -x; cd "$(dirname "$file")" && cargo update -w --locked) done -
When wanting to update (minimally), I recommend instead to replace
--lockedwith-v:-w -v.