Cargoプロジェクト Examplesの追加

Cargoで作ったライブラリプロジェクトにExamplesを追加することができる。

xion.io

// examples/hello.rs
fn main() {
    println!("Hello from an example!");
}
$ cargo run --example hello
$ cargo run --example hello2 -- Alice