`cargo update --dev`

Is there anyway to update a development dependencies through cargo update instead of manually updating or deleting and re-adding? I don't see anything in the help message of cargo update for doing so.

update doesn't change the manifest.

There's cargo-edit crate that adds upgrade command that can change the manifest. I don't remember if it has dev-only option.

Even if it doesn't change Cargo.lock, should cargo update support updating dev dependencies? Is that something worth adding to cargo in a PR

cargo update will update Cargo.lock (the lockfile), and it will update dev dependencies to the latest semver-compatible versions, just like any other dependency. It won't update to major incompatible versions, and it won't rewrite Cargo.toml (the manifest).

Note that per Cargo rules 0.1.0 and 0.2.0 are incompatible major versions, and 0.x won't be updated to 0.y.

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.