Fix example SELF_ASSIGNMENT

This commit is contained in:
alexey semenyuk 2022-06-25 11:57:32 +00:00 committed by alex-semenyuk
parent eaa03ea911
commit c6a2221393

View file

@ -20,14 +20,22 @@ declare_clippy_lint! {
/// ### Example /// ### Example
/// ```rust /// ```rust
/// struct Event { /// struct Event {
/// id: usize,
/// x: i32, /// 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) { /// fn copy_position(a: &mut Event, b: &Event) {
/// a.x = b.x; /// a.x = b.x;
/// a.y = a.y;
/// } /// }
/// ``` /// ```
#[clippy::version = "1.48.0"] #[clippy::version = "1.48.0"]