ahead-of-time compiled language
# install
curl https://sh.rustup.rs -sSf | sh
# uninstall
rustup self uninstall
# compiling
rustc main.rs
# run
./main
[project]
|-[src]
|-[target]
| |-[debug]
| `-[release]
|-Cargo.lock
`-Cargo.tomal
Cargo.toml
[package]
name = "package_name"
version = "version_number"
authors = ["your_name <your_email@example.com>"]
[profile.dev]
opt-level = 0
[profile.release]
opt-level = 3
[workspace]
member = [
"crate_one",
"crate_two"
]
crate_one/Cargo.toml
crate_two = {path = "../crate_two"}
optimizations(default values)
env | opt-level |
---|---|
dev | 0 |
release | 3 |
# cargo new project_name
# building
cargo build
# cargo new --bin project_name
# running
cargo run
cargo test
cargo doc --open
cargo build --release
cargo new project_name
cargo new project_name --bin