Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/ch03-03-how-functions-work.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ Compiling this code will produce an error, as follows:
The main error message, `mismatched types`, reveals the core issue with this
code. The definition of the function `plus_one` says that it will return an
`i32`, but statements don’t evaluate to a value, which is expressed by `()`,
the unit type. Therefore, nothing is returned, which contradicts the function
definition and results in an error. In this output, Rust provides a message to
possibly help rectify this issue: It suggests removing the semicolon, which
would fix the error.
the unit type. Therefore, the function implicitly returns `()`, which
contradicts the function definition and results in an error. In this output,
Rust provides a message to possibly help rectify this issue: It suggests
removing the semicolon, which would fix the error.