]> git.lizzy.rs Git - rust.git/blob - src/docs/multiple_inherent_impl.txt
Auto merge of #9421 - xphoniex:fix-#9420, r=giraffate
[rust.git] / src / docs / multiple_inherent_impl.txt
1 ### What it does
2 Checks for multiple inherent implementations of a struct
3
4 ### Why is this bad?
5 Splitting the implementation of a type makes the code harder to navigate.
6
7 ### Example
8 ```
9 struct X;
10 impl X {
11     fn one() {}
12 }
13 impl X {
14     fn other() {}
15 }
16 ```
17
18 Could be written:
19
20 ```
21 struct X;
22 impl X {
23     fn one() {}
24     fn other() {}
25 }
26 ```