mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-10 05:53:10 +00:00
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:
commit
d85539571f
@ -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"]
|
||||
|
Loading…
Reference in New Issue
Block a user