Auto merge of #9045 - alex-semenyuk:self_assignment_example, r=llogiq

Fix example `SELF_ASSIGNMENT`

changelog: Fix example in `SELF_ASSIGNMENT` docs
This commit is contained in:
bors 2022-06-27 17:33:31 +00:00
commit d85539571f

View File

@ -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"]