Rust Programming Cookbook
上QQ阅读APP看书,第一时间看更新

Getting ready

First, create a new project using cargo new iteration --lib and add the following to the newly created Cargo.toml file in the project's directory:

[dev-dependencies]
rand = "^0.5"

This adds a dependency to the rand (https://github.com/rust-random/rand) crate to the project, which will be installed upon running cargo test the first time. Open the entire project (or the src/lib.rs file) in Visual Studio Code.