mirror of
https://github.com/rust-lang/rust-clippy
synced 2025-02-26 04:17:21 +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
|
/// ### 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"]
|
||||||
|
|
Loading…
Add table
Reference in a new issue