mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
misc: Fix clippy - more concise repeat().take()
Reported by 1.86.0-beta.1 (f0cb41030 2025-02-17). Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
This commit is contained in:
@@ -1020,8 +1020,7 @@ impl DeviceManager {
|
||||
};
|
||||
|
||||
let mut mmio32_aperture_weights: Vec<u32> =
|
||||
std::iter::repeat(DEFAULT_PCI_SEGMENT_APERTURE_WEIGHT)
|
||||
.take(num_pci_segments.into())
|
||||
std::iter::repeat_n(DEFAULT_PCI_SEGMENT_APERTURE_WEIGHT, num_pci_segments.into())
|
||||
.collect();
|
||||
if let Some(pci_segments) = &config.lock().unwrap().pci_segments {
|
||||
for pci_segment in pci_segments.iter() {
|
||||
@@ -1041,8 +1040,7 @@ impl DeviceManager {
|
||||
);
|
||||
|
||||
let mut mmio64_aperture_weights: Vec<u32> =
|
||||
std::iter::repeat(DEFAULT_PCI_SEGMENT_APERTURE_WEIGHT)
|
||||
.take(num_pci_segments.into())
|
||||
std::iter::repeat_n(DEFAULT_PCI_SEGMENT_APERTURE_WEIGHT, num_pci_segments.into())
|
||||
.collect();
|
||||
if let Some(pci_segments) = &config.lock().unwrap().pci_segments {
|
||||
for pci_segment in pci_segments.iter() {
|
||||
|
||||
Reference in New Issue
Block a user