mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-07 17:18:32 +03:00
16 lines
289 B
Plaintext
16 lines
289 B
Plaintext
### What it does
|
|
Checks for literal calls to `Default::default()`.
|
|
|
|
### Why is this bad?
|
|
It's easier for the reader if the name of the type is used, rather than the
|
|
generic `Default`.
|
|
|
|
### Example
|
|
```
|
|
let s: String = Default::default();
|
|
```
|
|
|
|
Use instead:
|
|
```
|
|
let s = String::default();
|
|
``` |