Update dependency with cargo

Not sure if I just missed the relevant section in the documentation, but is there a command to update a dependency to the most recent version (accepting possible breakage)?

cargo update will only update Cargo.lock, and cargo add doesn't seem to do anything if there's already an entry with a (possibly old) version in the Cargo.toml.

I use the VSCode extesion serayuzgur.crates for doing that interactively.

There are commands for this in https://crates.io/crates/cargo-edit
and I think there are plans to eventually integrate that into cargo proper.

1 Like

There is cargo-outdated as well

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.