From fb27c66f7c5ab87fd7f7241c5045183040ed7917 Mon Sep 17 00:00:00 2001 From: Gokhan Karabulut Date: Sat, 16 Apr 2022 00:04:22 +0300 Subject: [PATCH] Use rust 2018 module file hierarchy With 2018 edition we no longer need mod.rs files. The book follows the new convention in its dedicated chapter and the reference encourages its usage over the mod.rs files. In order to be consistent with the book, we now have `my.rs` and `my` folder in the same directory instead of `my/mod.rs`. --- src/mod/split.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/mod/split.md b/src/mod/split.md index 634e7efae1..2c78ee2b8b 100644 --- a/src/mod/split.md +++ b/src/mod/split.md @@ -6,17 +6,17 @@ Modules can be mapped to a file/directory hierarchy. Let's break down the ```shell $ tree . . -|-- my -| |-- inaccessible.rs -| |-- mod.rs -| `-- nested.rs -`-- split.rs +├── my +│   ├── inaccessible.rs +│   └── nested.rs +├── my.rs +└── split.rs ``` In `split.rs`: ```rust,ignore -// This declaration will look for a file named `my.rs` or `my/mod.rs` and will +// This declaration will look for a file named `my.rs` and will // insert its contents inside a module named `my` under this scope mod my; @@ -36,7 +36,7 @@ fn main() { ``` -In `my/mod.rs`: +In `my.rs`: ```rust,ignore // Similarly `mod inaccessible` and `mod nested` will locate the `nested.rs`