Skip to content

Commit fbc374d

Browse files
committed
Auto merge of #6621 - giraffate:improve_the_example_in_ref_in_deref, r=flip1995
Improve the example in `ref_in_deref` Add a suggested code to the example in doc changelog: none
2 parents 043cf97 + 23662d1 commit fbc374d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

clippy_lints/src/reference.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ declare_clippy_lint! {
111111
/// let point = Point(30, 20);
112112
/// let x = (&point).0;
113113
/// ```
114+
/// Use instead:
115+
/// ```rust
116+
/// # struct Point(u32, u32);
117+
/// # let point = Point(30, 20);
118+
/// let x = point.0;
119+
/// ```
114120
pub REF_IN_DEREF,
115121
complexity,
116122
"Use of reference in auto dereference expression."

0 commit comments

Comments
 (0)