Enable clippy::drain_collect (#8745)

This PR enables the
[`clippy::drain_collect`](https://rust-lang.github.io/rust-clippy/master/index.html#/drain_collect)
rule and fixes the outstanding violations.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-03-02 21:14:42 -05:00 committed by GitHub
parent 4097e8870b
commit bd00aed7db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 2 deletions

View File

@ -2883,7 +2883,7 @@ impl LineWithInvisibles {
.unwrap();
layouts.push(Self {
line: shaped_line,
invisibles: invisibles.drain(..).collect(),
invisibles: std::mem::take(&mut invisibles),
});
line.clear();

View File

@ -89,7 +89,6 @@ fn run_clippy(args: ClippyArgs) -> Result<()> {
"clippy::default_constructed_unit_structs",
"clippy::derivable_impls",
"clippy::derive_ord_xor_partial_ord",
"clippy::drain_collect",
"clippy::eq_op",
"clippy::expect_fun_call",
"clippy::explicit_auto_deref",