Skip to content

Commit

Permalink
Merge pull request #3870 from rust-lang/fix-2980
Browse files Browse the repository at this point in the history
Clarify function definitions vs. expressions
  • Loading branch information
chriskrycho committed Jul 23, 2024
2 parents 743d2e2 + e2a5258 commit 98dd2c1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ch03-03-how-functions-work.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ assigning a value to it with the `let` keyword is a statement. In Listing 3-1,
</Listing>

Function definitions are also statements; the entire preceding example is a
statement in itself.
statement in itself. (As we will see below, *calling* a function is not a
statement.)

Statements do not return values. Therefore, you can’t assign a `let` statement
to another variable, as the following code tries to do; you’ll get an error:
Expand Down

0 comments on commit 98dd2c1

Please sign in to comment.