在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
InstallingThe easiest way to get Cargo is to get the current stable release of Rust by using the
This will get you the current stable release of Rust for your platform along with the latest Cargo. If you are on Windows, you can directly download the latest 32bit (Rust and Cargo) or 64bit (Rust andCargo) Rust stable releases or Cargo nightlies. Alternatively, you can build Cargo from source. Let’s get startedTo start a new project with Cargo, use
We’re passing Let’s check out what Cargo has generated for us:
This is all we need to get started. First, let’s check out
This is called a manifest, and it contains all of the metadata that Cargo needs to compile your project. Here’s what’s in fn main() {
println!("Hello, world!");
}
Cargo generated a “hello world” for us. Let’s compile it:
And then run it:
We can also use
Going furtherFor more details on using Cargo, check out the Cargo Guide |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论