从 https://crates.io 安装二进制(binary target,可执行程序,既拥有 src/main.rs
或指定二进制文件)的 crate。
介绍
crate 拥有的 target 分类:
-
binary target
-
library target
-
示例
$ cargo install x_demo
Updating crates.io index
Downloaded x_demo v0.1.0
Downloaded 1 crate (8.2 KB) in 2.10s
Installing x_demo v0.1.0
Compiling x_demo v0.1.0
Finished release [optimized] target(s) in 23.96s
Installing /Users/xiexianbin/.cargo/bin/x_demo
Installed package `x_demo v0.1.0` (executable `x_demo`)
说明: