Improve the example in ref_in_deref
This commit is contained in:
parent
043cf97abc
commit
23662d1353
@ -111,6 +111,12 @@ fn check_expr(&mut self, cx: &EarlyContext<'_>, e: &Expr) {
|
||||
/// let point = Point(30, 20);
|
||||
/// let x = (&point).0;
|
||||
/// ```
|
||||
/// Use instead:
|
||||
/// ```rust
|
||||
/// # struct Point(u32, u32);
|
||||
/// # let point = Point(30, 20);
|
||||
/// let x = point.0;
|
||||
/// ```
|
||||
pub REF_IN_DEREF,
|
||||
complexity,
|
||||
"Use of reference in auto dereference expression."
|
||||
|
Loading…
Reference in New Issue
Block a user