mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-01 00:49:30 +00:00
Fix example SELF_ASSIGNMENT
This commit is contained in:
parent
eaa03ea911
commit
c6a2221393
1 changed files with 11 additions and 3 deletions
|
@ -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 a new issue