pci: Fix clippy: use mem::take instead of drain().collect()

```
warning: you seem to be trying to move all elements into a new `Vec`
   --> pci/src/configuration.rs:951:24
    |
951 |                 return self.pending_bar_reprogram.drain(..).collect();
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `mem::take` to avoid creating a new allocation: `std::mem::take(&mut self.pending_bar_reprogram)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#drain_collect
    = note: `-D clippy::drain-collect` implied by `-D clippy::all`
```

Signed-off-by: Rob Bradford <rbradford@meta.com>
This commit is contained in:
Rob Bradford
2026-07-06 23:28:07 +01:00
parent 308033de40
commit 52f5d5fc9a

View File

@@ -4,8 +4,8 @@
//
// SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause
use std::result;
use std::sync::{Arc, Mutex};
use std::{mem, result};
use byteorder::{ByteOrder, LittleEndian};
use log::{info, warn};
@@ -948,7 +948,7 @@ impl PciConfiguration {
"BAR reprogramming parameter is returned: {:x?}",
self.pending_bar_reprogram
);
return self.pending_bar_reprogram.drain(..).collect();
return mem::take(&mut self.pending_bar_reprogram);
}
info!(
"MSE bit is disabled. No BAR reprogramming parameter is returned: {:x?}",