]> git.lizzy.rs Git - rust.git/blob - src/docs/useless_conversion.txt
Auto merge of #9425 - kraktus:patch-1, r=xFrednet
[rust.git] / src / docs / useless_conversion.txt
1 ### What it does
2 Checks for `Into`, `TryInto`, `From`, `TryFrom`, or `IntoIter` calls
3 which uselessly convert to the same type.
4
5 ### Why is this bad?
6 Redundant code.
7
8 ### Example
9 ```
10 // format!() returns a `String`
11 let s: String = format!("hello").into();
12 ```
13
14 Use instead:
15 ```
16 let s: String = format!("hello");
17 ```