Rust Tutorial

Rust Functions

Functions

Functions group reusable logic behind a name you can call anywhere.

fn greet(name: &str) -> String {
  format!("Hello, {}", name)
}
Try it Yourself
Run this RUST example in your local environment or course sandbox.