Glossary coding Term Page
? Operator
Rust syntax for early-returning failure paths cleanly
Core Idea
The [[question-mark-operator|? operator]] shortens Rust control flow by returning early when a [[result|Result]] or [[option|Option]] is in a failure state. It removes repetitive match blocks and keeps the success path easier to read from top to bottom.
Why It Matters Here
Mathbong uses the ? operator in file reads, JSON parsing, async functions, and CLI flows. It is one of the quickest ways for beginners to feel what error propagation means in real Rust code.