Rob's Wiki
Search…
Rust

Installation

Install rustup:
1
brew install rustup-init
2
rustup-init
Copied!
1
rustup update
2
rustup component add rls-preview rust-analysis rust-src
Copied!

Hello World

1
// hello.rs
2
fn main() {
3
println!("Hello World!");
4
}
Copied!
1
rustc hello.rs
2
./hello
Copied!

Packaging etc

  • Packaging is done with Cargo
  • Each distributed package is called a Crate
  • The primary Crate registry is Crates.io
  • A simple starting guide is here
To create a new project, then compile and run it:
1
cargo new rust_example
2
cd rust_example
3
cargo run
Copied!
Last modified 3yr ago