Basics
Hello
Values and Output
A Rust program runs from main. This example binds a name, builds a greeting with format!, and prints it.
Program
Play the program to watch name flow into greeting, then print.
hello.rs
fn main() {
let name = "Ada";
let greeting = format!("Hello, {name}!");
println!("{greeting}");
}
let binding
`let` binds a value to an immutable name.
format!
`format!` builds a `String` from a template and values.
println!
`println!` writes a line to standard output.