x series, you’d have to update the Cargo. To use rand version 0.9.0 or any version in the 0.9. At this point, you would also notice a change in your Cargo.lock file noting that the version of the rand crate you are now using is 0.8.6. ![]() If the rand crate has released the two new versions 0.8.6 and 0.9.0, you would see the following if you ran cargo update: $ cargo updateĬargo ignores the 0.9.0 release. Otherwise, by default, Cargo will only look for versions greater than 0.8.5 and less than 0.9.0. Cargo will then write those versions to the Cargo.lock file. 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. Here is that problematic section from the book - I made that sentence italic: Updating a Crate to Get a New Version Unfortunately, the GitHub issue tracker of the book is inactive currently, so I hesitated to create an issue. Most problematic is the start with "Otherwise", but "by default" does not make much sense as well. Is this sentence a bug? I read that section multiple times (as a non native speaker, but with that sentence it remains confusing. With removing this sentence, all is clear and easily understandable. The home crate provides an API for getting this location if you need this information inside your Rust. You can alter the location of the Cargo home by setting the CARGOHOME environmental variable. When building a crate, Cargo stores downloaded build dependencies in the Cargo home. ![]() One is the following, where the one sentence "Otherwise, by default, Cargo will only look for versions greater than 0.8.5 and less than 0.9.0." makes no sense to me. The Cargo home functions as a download and source cache. See The Cargo Book: External tools for more on this topic. Still, a few sections of the book are confusing to me. Updated on each update of the cargo submodule in rust-lang/rust. Profiles provide a way to alter the compiler settings, influencing things like optimizations and debugging symbols. ![]() In the last weeks, I read nearly all of the official rust book, and recently additional the fine summary from A half-hour to learn Rust
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |