function

Rust allows hoisting. Functions can be declared and called from anywhere in the code.

Example function syntax:

fn name_of_func(argument) {
	// ...
}

expressions return a value and statements do not.

an expression that evaluates to a certain value or mathematical operation will evaluate to the last line in the expression and therefore the last expression does not require a ;

e.g.

let _x = {
	let price = 5;
	let qty = 10;
	price * qty
};`

functions returning values

fn add(a: i32, b: i32) -> i32{a+b}
(parameter a and b added) -> (data type that you want returned)