Skip to content

Commit

Permalink
Clarify function definition must be in an accessible scope. Fixes #3003
Browse files Browse the repository at this point in the history
  • Loading branch information
carols10cents committed Apr 21, 2022
1 parent c2e5b78 commit 223d6a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ch03-03-how-functions-work.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ of parentheses. Because `another_function` is defined in the program, it can be
called from inside the `main` function. Note that we defined `another_function`
*after* the `main` function in the source code; we could have defined it before
as well. Rust doesn’t care where you define your functions, only that they’re
defined somewhere.
defined somewhere in a scope that can be seen by the caller.

Let’s start a new binary project named *functions* to explore functions
further. Place the `another_function` example in *src/main.rs* and run it. You
Expand Down

0 comments on commit 223d6a1

Please sign in to comment.