From 23662d1353a52be7c35bb3905337f2aadf7c504a Mon Sep 17 00:00:00 2001 From: Takayuki Nakata Date: Fri, 22 Jan 2021 22:51:06 +0900 Subject: [PATCH] Improve the example in `ref_in_deref` --- clippy_lints/src/reference.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/clippy_lints/src/reference.rs b/clippy_lints/src/reference.rs index 2dfb947b5eb..e1450466a7c 100644 --- a/clippy_lints/src/reference.rs +++ b/clippy_lints/src/reference.rs @@ -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."