Skip to content

Glossary: Rust Basics

return

Also written: return type, returns

`return` hands back a value straight away and leaves the function. The return type, written after `->`, is the type of what a function gives back; the last expression without a semicolon also returns.

Where the book teaches it

Related terms

FunctionExpressionUnit type