Ubuntu20.04 でRustの環境構築

$ curl –proto ‘=https’ –tlsv1.2 -sSf https://sh.rustup.rs | sh
$ sudo apt install cargo
$ cargo new –bin hello
$ cd hello
$ cargo build
Compiling hello v0.1.0 (/home/vagrant/dev/rust/hello)
Finished dev [unoptimized + debuginfo] target(s) in 0.32s
$ tree
.
├── Cargo.lock
├── Cargo.toml
├── src
│   └── main.rs
└── target
├── CACHEDIR.TAG
└── debug
├── build
├── deps
│   ├── hello-2ab4b0e0c3958f3e
│   └── hello-2ab4b0e0c3958f3e.d
├── examples
├── hello
├── hello.d
└── incremental

7 directories, 8 files

$ target/debug/hello
Hello, world!

ファイルの中身を見てみる
hello/src/main.rs

fn main() {
    println!("Hello, world!");
}

中身をtour of rustと同じにする

fn main() {
    println!("Hello, 🦀");
}

$ cargo build
$ target/debug/hello
Hello, 🦀

なるほど…