Skip to content

Commit fb27c66

Browse files
author
Gokhan Karabulut
committed
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`.
1 parent c2a98d9 commit fb27c66

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/mod/split.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ Modules can be mapped to a file/directory hierarchy. Let's break down the
66
```shell
77
$ tree .
88
.
9-
|-- my
10-
| |-- inaccessible.rs
11-
| |-- mod.rs
12-
| `-- nested.rs
13-
`-- split.rs
9+
├── my
10+
│   ├── inaccessible.rs
11+
│   └── nested.rs
12+
├── my.rs
13+
└── split.rs
1414
```
1515

1616
In `split.rs`:
1717

1818
```rust,ignore
19-
// This declaration will look for a file named `my.rs` or `my/mod.rs` and will
19+
// This declaration will look for a file named `my.rs` and will
2020
// insert its contents inside a module named `my` under this scope
2121
mod my;
2222
@@ -36,7 +36,7 @@ fn main() {
3636
3737
```
3838

39-
In `my/mod.rs`:
39+
In `my.rs`:
4040

4141
```rust,ignore
4242
// Similarly `mod inaccessible` and `mod nested` will locate the `nested.rs`

0 commit comments

Comments
 (0)