Skip to content

Commit

Permalink
Merge pull request #1532 from gokhanettin/update-module-file-hierarchy
Browse files Browse the repository at this point in the history
Use rust 2018 module file hierarchy
  • Loading branch information
marioidival authored Apr 19, 2022
2 parents c2a98d9 + fb27c66 commit 44a80e8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/mod/split.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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`
Expand Down

0 comments on commit 44a80e8

Please sign in to comment.