From f3475a665260b0e9811b727643aee7b652e70e8f Mon Sep 17 00:00:00 2001 From: steveklabnik Date: Thu, 17 Nov 2016 13:12:47 -0500 Subject: [PATCH] Make it clear that mod isn't specific to lib.rs Fixes #328. --- src/ch07-01-mod-and-the-filesystem.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ch07-01-mod-and-the-filesystem.md b/src/ch07-01-mod-and-the-filesystem.md index 1740663d8..a387bbc89 100644 --- a/src/ch07-01-mod-and-the-filesystem.md +++ b/src/ch07-01-mod-and-the-filesystem.md @@ -94,7 +94,9 @@ Now we have a `network::connect` function and a `client::connect` function. These can have completely different functionality, and the function names do not conflict with each other since they’re in different modules. -We can also put modules inside of modules. This can be useful as your modules +While in this case, we’re building a library, there's nothing special about +`lib.rs`. We could also make use of submodules in a `main.rs` as well. In fact, +we can also put modules inside of modules. This can be useful as your modules grow to keep related functionality organized together and separate functionality apart. The choice of how you organize your code depends on how you think about the relationship between the parts of your code. For instance,