]> git.lizzy.rs Git - rust.git/blob - src/docs/explicit_auto_deref.txt
Auto merge of #9421 - xphoniex:fix-#9420, r=giraffate
[rust.git] / src / docs / explicit_auto_deref.txt
1 ### What it does
2 Checks for dereferencing expressions which would be covered by auto-deref.
3
4 ### Why is this bad?
5 This unnecessarily complicates the code.
6
7 ### Example
8 ```
9 let x = String::new();
10 let y: &str = &*x;
11 ```
12 Use instead:
13 ```
14 let x = String::new();
15 let y: &str = &x;
16 ```