Hello World
To make a hello world in rust, it’s pretty dang easy.
- Run
cargo new hello-world
, thencd hello-world
. - This will actually scaffold a hello world for you but here it is as well. In
src/main.rs
, write this:
fn main() {
println!("Hello, world!");
}
- Lastly, run this:
cargo run
.
Boom, done. Hello world with Rust.
Last modified: