Skip to content

Commit

Permalink
Resolve clippy append_instead_of_extend lint
Browse files Browse the repository at this point in the history
    error: use of `extend` instead of `append` for adding the full range of a second vector
        --> src/item.rs:1811:13
         |
    1811 |             attrs.extend(item_attrs.drain(..));
         |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `attrs.append(&mut item_attrs)`
         |
         = note: `-D clippy::append-instead-of-extend` implied by `-D clippy::all`
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#append_instead_of_extend

    error: use of `extend` instead of `append` for adding the full range of a second vector
        --> src/item.rs:2296:13
         |
    2296 |             attrs.extend(item_attrs.drain(..));
         |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `attrs.append(&mut item_attrs)`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#append_instead_of_extend

    error: use of `extend` instead of `append` for adding the full range of a second vector
        --> src/item.rs:2640:17
         |
    2640 |                 attrs.extend(item_attrs.drain(..));
         |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `attrs.append(&mut item_attrs)`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#append_instead_of_extend
  • Loading branch information
dtolnay committed Jul 3, 2021
1 parent ffbb00f commit 1296bac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1808,7 +1808,7 @@ pub mod parsing {
#[cfg(not(test))]
_ => unreachable!(),
};
attrs.extend(item_attrs.drain(..));
attrs.append(item_attrs);
*item_attrs = attrs;

Ok(item)
Expand Down Expand Up @@ -2293,7 +2293,7 @@ pub mod parsing {
#[cfg(not(test))]
_ => unreachable!(),
};
attrs.extend(item_attrs.drain(..));
attrs.append(item_attrs);
*item_attrs = attrs;
Ok(item)
}
Expand Down Expand Up @@ -2637,7 +2637,7 @@ pub mod parsing {
#[cfg(not(test))]
_ => unreachable!(),
};
attrs.extend(item_attrs.drain(..));
attrs.append(item_attrs);
*item_attrs = attrs;
}

Expand Down

0 comments on commit 1296bac

Please sign in to comment.