summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/duplicate_mod.txt
blob: 709a9aba03ad29d1519993a1fd689e6c9855da9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
### What it does
Checks for files that are included as modules multiple times.

### Why is this bad?
Loading a file as a module more than once causes it to be compiled
multiple times, taking longer and putting duplicate content into the
module tree.

### Example
```
// lib.rs
mod a;
mod b;
```
```
// a.rs
#[path = "./b.rs"]
mod b;
```

Use instead:

```
// lib.rs
mod a;
mod b;
```
```
// a.rs
use crate::b;
```