From 3962c0224b274e2358e0acf06443af64df115359 Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Fri, 28 Oct 2022 16:38:54 -0400 Subject: [PATCH] Clarify that the conditional expression is the one under discussion Rather than the return expression. Fixes #3168. --- src/ch06-02-match.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ch06-02-match.md b/src/ch06-02-match.md index 4ba4781cd..6a510df40 100644 --- a/src/ch06-02-match.md +++ b/src/ch06-02-match.md @@ -31,10 +31,10 @@ the variants of the enum as its patterns Let’s break down the `match` in the `value_in_cents` function. First we list the `match` keyword followed by an expression, which in this case is the value -`coin`. This seems very similar to an expression used with `if`, but there’s a -big difference: with `if`, the expression needs to return a Boolean value, but -here it can return any type. The type of `coin` in this example is the `Coin` -enum that we defined on the first line. +`coin`. This seems very similar to a conditional expression used with `if`, but +there’s a big difference: with `if`, the condition needs to evaluate to a +Boolean value, but here it can be any type. The type of `coin` in this example +is the `Coin` enum that we defined on the first line. Next are the `match` arms. An arm has two parts: a pattern and some code. The first arm here has a pattern that is the value `Coin::Penny` and then the `=>`