diff options
Diffstat (limited to '')
-rw-r--r-- | src/tools/clippy/src/docs/explicit_auto_deref.txt | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/tools/clippy/src/docs/explicit_auto_deref.txt b/src/tools/clippy/src/docs/explicit_auto_deref.txt new file mode 100644 index 000000000..65b256317 --- /dev/null +++ b/src/tools/clippy/src/docs/explicit_auto_deref.txt @@ -0,0 +1,16 @@ +### What it does +Checks for dereferencing expressions which would be covered by auto-deref. + +### Why is this bad? +This unnecessarily complicates the code. + +### Example +``` +let x = String::new(); +let y: &str = &*x; +``` +Use instead: +``` +let x = String::new(); +let y: &str = &x; +```
\ No newline at end of file |