---
title: "Chapter 2: Functions"
description: "The 7 lessons of chapter 2: Functions, in teaching order."
url: "https://learnrust.net/chapter-2/"
last_updated: "2026-06-11"
---

# Chapter 2: Functions

- [2.1 Introduction to functions](https://learnrust.net/chapter-2/introduction-to-functions.md): Defining and calling Rust functions, tracing the flow of control, and why definition order doesn't matter.
- [2.2 Function return values](https://learnrust.net/chapter-2/return-values.md): Rust return types, tail expressions as return values, the return keyword, and the missing-semicolon error every beginner meets.
- [2.3 Function parameters and arguments](https://learnrust.net/chapter-2/parameters-and-arguments.md): Parameters versus arguments in Rust, why every parameter is explicitly typed, and how values are copied into calls.
- [2.4 Local scope and blocks](https://learnrust.net/chapter-2/local-scope-and-blocks.md): Where Rust variables live and die: scope, blocks, shadowing across functions, and defining variables near first use.
- [2.5 Why functions are useful](https://learnrust.net/chapter-2/why-functions-are-useful.md): The five things functions buy you, when to split code into one, and the read-compute-print pattern.
- [2.6 How to design your first programs](https://learnrust.net/chapter-2/designing-your-first-programs.md): Turning a problem into a program: goals, requirements, top-down decomposition, and building one tested function at a time.
- [2.x Chapter 2 summary and quiz](https://learnrust.net/chapter-2/chapter-2-summary-and-quiz.md): Chapter 2's terms in review, plus the classic three-function program quiz.

## Sitemap

See the full [sitemap](https://learnrust.net/sitemap.md) for all pages.
