mirror of
https://github.com/rust-lang/book.git
synced 2026-12-01 14:56:08 -06:00
Merge pull request #3870 from rust-lang/fix-2980
Clarify function definitions vs. expressions
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user