Rust

Cargo-New Project

2019-10-26  本文已影响0人  空乱木

1-创建可执行
[@zhous-MBP-2:] ~/blockchain/rust cargo new hello_cargo --bin Created binary (application) `hello_cargo` package [@zhous-MBP-2:] ~/blockchain/rust ls -l
total 0
drwxr-xr-x 6 zhouhe staff 192 Oct 26 20:27 hello_cargo
[@zhous-MBP-2:] ~/blockchain/rust $

2-目录结构
[@zhous-MBP-2:] ~/blockchain/rust cd hello_cargo/ [@zhous-MBP-2:] ~/blockchain/rust/hello_cargo tree
.
├── Cargo.toml
└── src
└── main.rs

1 directory, 2 files
[@zhous-MBP-2:] ~/blockchain/rust/hello_cargo $

3- 运行
[zhouhe@zhous-MBP-2:] ~/blockchain/rust/hello_cargo cargo run Compiling hello_cargo v0.1.0 (/Users/zhouhe/blockchain/rust/hello_cargo) Finished dev [unoptimized + debuginfo] target(s) in 1.31s Running `target/debug/hello_cargo` Hello, world! [zhouhe@zhous-MBP-2:] ~/blockchain/rust/hello_cargo

上一篇下一篇

猜你喜欢

热点阅读