Doubt regarding Cargo update

" When you do want to update a crate, Cargo provides the command update , which will ignore the Cargo.lock file and figure out all the latest versions that fit your specifications in Cargo.toml . Cargo will then write those versions to the Cargo.lock file."(Chapter 2 of the book)

My question is that i really dont understand this point. I have tried everything from "^0.8.5" to ">0.8.5 , <0.10.0"; still its not changing the version in toml file for rand crate.

Does anyone knows answer to it

cargo update updates Cargo.lock

To update Cargo.toml, you can do it manually, or use for example cargo upgrade (provided by cargo install cargo-edit)

6 Likes