book
book copied to clipboard
Cargo update not acting as shown?
- [X] I have checked the latest
mainbranch to see if this has already been fixed - [X] I have searched existing issues and pull requests for duplicates
URL to the section(s) of the book with this problem: https://doc.rust-lang.org/book/ch02-00-guessing-game-tutorial.html#updating-a-crate-to-get-a-new-version
Description of the problem:
I've been through all the text and I think I'm blind - my Cargo.toml says 0.8.3, and when i run cargo update it just says:
❯ cargo update
Updating crates.io index
❯ cargo search rand
rand = "0.8.4" # Random number generators and other randomness functionality.
[...]
❯
Suggested fix: Am I missing something? The Cargo.toml is still reading 0.8.3 too.
What's in your Cargo.lock file? Because 0.8.3 actually means "any version at least 0.8.3 considered API compatible with 0.8.3", and because rand 0.8.4 is available, you probably got 0.8.4 initially. Cargo.lock records the exact versions that Cargo chose to satisfy the version constrains specified in Cargo.toml.