Reading The Rust Book from cover to cover — Day 5 — Functions

Jaspreet Kaur
2 min readApr 10, 2024

Functions

Functions in Rust are defined with the keyword fn. The structure and syntax are the same as most of the other languages. Rust uses asnake_case convention for multi-word function names.

Function examples:

fn main() {
println!("Hello, world!");
another_function()…

--

--