From 1296bacabd0d1a85d6ea26a6adabb8b079c3ed6f Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 2 Jul 2021 21:19:21 -0700 Subject: [PATCH] Resolve clippy append_instead_of_extend lint 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 --- src/item.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/item.rs b/src/item.rs index acc56f8616..40d94e05de 100644 --- a/src/item.rs +++ b/src/item.rs @@ -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) @@ -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) } @@ -2637,7 +2637,7 @@ pub mod parsing { #[cfg(not(test))] _ => unreachable!(), }; - attrs.extend(item_attrs.drain(..)); + attrs.append(item_attrs); *item_attrs = attrs; }