Skip to content

Commit

Permalink
Auto merge of rust-lang#9045 - alex-semenyuk:self_assignment_example,…
Browse files Browse the repository at this point in the history
… r=llogiq

Fix example `SELF_ASSIGNMENT`

changelog: Fix example in `SELF_ASSIGNMENT` docs
  • Loading branch information
bors committed Jun 27, 2022
2 parents fdd0e72 + c6a2221 commit d855395
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions clippy_lints/src/self_assignment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,22 @@ declare_clippy_lint! {
/// ### Example
/// ```rust
/// struct Event {
/// id: usize,
/// x: i32,
/// y: i32,
/// }
///
/// fn copy_position(a: &mut Event, b: &Event) {
/// a.x = a.x;
/// }
/// ```
///
/// Should be:
/// ```rust
/// struct Event {
/// x: i32,
/// }
///
/// fn copy_position(a: &mut Event, b: &Event) {
/// a.x = b.x;
/// a.y = a.y;
/// }
/// ```
#[clippy::version = "1.48.0"]
Expand Down

0 comments on commit d855395

Please sign in to comment.