summaryrefslogtreecommitdiff
path: root/How to return from a function.md
blob: 0fde1fcbdf380a5d2216f97d3bbb27362fb92f7c (plain)
1
2
3
4
5
6
[[Rust]]
[[Adding a semicolon to the end of a line turns it into a statement]]

In Rust we can return from a function with simply an expression at the end of the scope.

The `return` keyword is mostly used for returning early.