diff options
Diffstat (limited to 'src/docs/explicit_deref_methods.txt')
| -rw-r--r-- | src/docs/explicit_deref_methods.txt | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/src/docs/explicit_deref_methods.txt b/src/docs/explicit_deref_methods.txt deleted file mode 100644 index e14e981c707..00000000000 --- a/src/docs/explicit_deref_methods.txt +++ /dev/null @@ -1,24 +0,0 @@ -### What it does -Checks for explicit `deref()` or `deref_mut()` method calls. - -### Why is this bad? -Dereferencing by `&*x` or `&mut *x` is clearer and more concise, -when not part of a method chain. - -### Example -``` -use std::ops::Deref; -let a: &mut String = &mut String::from("foo"); -let b: &str = a.deref(); -``` - -Use instead: -``` -let a: &mut String = &mut String::from("foo"); -let b = &*a; -``` - -This lint excludes: -``` -let _ = d.unwrap().deref(); -``` \ No newline at end of file |
