Skip to content

Commit d855395

Browse files
committed
Auto merge of #9045 - alex-semenyuk:self_assignment_example, r=llogiq
Fix example `SELF_ASSIGNMENT` changelog: Fix example in `SELF_ASSIGNMENT` docs
2 parents fdd0e72 + c6a2221 commit d855395

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

clippy_lints/src/self_assignment.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,22 @@ declare_clippy_lint! {
2020
/// ### Example
2121
/// ```rust
2222
/// struct Event {
23-
/// id: usize,
2423
/// x: i32,
25-
/// y: i32,
24+
/// }
25+
///
26+
/// fn copy_position(a: &mut Event, b: &Event) {
27+
/// a.x = a.x;
28+
/// }
29+
/// ```
30+
///
31+
/// Should be:
32+
/// ```rust
33+
/// struct Event {
34+
/// x: i32,
2635
/// }
2736
///
2837
/// fn copy_position(a: &mut Event, b: &Event) {
2938
/// a.x = b.x;
30-
/// a.y = a.y;
3139
/// }
3240
/// ```
3341
#[clippy::version = "1.48.0"]

0 commit comments

Comments
 (0)