Skip to content

Commit

Permalink
Merge pull request #3463 from bgurney-rh/rust-1.73
Browse files Browse the repository at this point in the history
Fix Rust 1.73 clippy errors
  • Loading branch information
mulkieran authored Oct 6, 2023
2 parents 355a4b4 + e14621e commit de75a5f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/engine/strat_engine/liminal/identify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,9 @@ fn find_all_luks_devices() -> libudev::Result<HashMap<PoolUuid, Vec<LuksInfo>>>
let pool_map = enumerator
.scan_devices()?
.filter_map(|dev| identify_luks_device(&UdevEngineDevice::from(&dev)))
.fold(HashMap::new(), |mut acc, info| {
.fold(HashMap::<PoolUuid, Vec<_>>::new(), |mut acc, info| {
acc.entry(info.identifiers.pool_uuid)
.or_insert_with(Vec::new)
.or_default()
.push(info);
acc
});
Expand All @@ -351,9 +351,9 @@ fn find_all_stratis_devices() -> libudev::Result<HashMap<PoolUuid, Vec<StratisIn
let pool_map = enumerator
.scan_devices()?
.filter_map(|dev| identify_stratis_device(&UdevEngineDevice::from(&dev)))
.fold(HashMap::new(), |mut acc, info| {
.fold(HashMap::<PoolUuid, Vec<_>>::new(), |mut acc, info| {
acc.entry(info.bda.identifiers().pool_uuid)
.or_insert_with(Vec::new)
.or_default()
.push(info);
acc
});
Expand Down
7 changes: 2 additions & 5 deletions src/engine/strat_engine/liminal/liminal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ impl LiminalDevices {
.stopped_pools
.remove(&pool_uuid)
.or_else(|| self.partially_constructed_pools.remove(&pool_uuid))
.unwrap_or_else(DeviceSet::new);
.unwrap_or_default();

self.uuid_lookup
.insert(device_path.to_path_buf(), (pool_uuid, device_uuid));
Expand Down Expand Up @@ -829,10 +829,7 @@ impl LiminalDevices {
return None;
};
if self.stopped_pools.get(&pool_uuid).is_some() {
let mut devices = self
.stopped_pools
.remove(&pool_uuid)
.unwrap_or_else(DeviceSet::new);
let mut devices = self.stopped_pools.remove(&pool_uuid).unwrap_or_default();

devices.process_info_remove(device_path, pool_uuid, dev_uuid);
self.uuid_lookup.remove(device_path);
Expand Down
4 changes: 2 additions & 2 deletions src/engine/strat_engine/liminal/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,15 @@ pub fn get_blockdevs(
for seg in &backstore_save.data_tier.blockdev.allocs[0] {
segment_table
.entry(seg.parent)
.or_insert_with(Vec::default)
.or_default()
.push((seg.start, seg.length))
}

if let Some(ref cache_tier) = backstore_save.cache_tier {
for seg in cache_tier.blockdev.allocs.iter().flat_map(|i| i.iter()) {
segment_table
.entry(seg.parent)
.or_insert_with(Vec::default)
.or_default()
.push((seg.start, seg.length))
}
}
Expand Down

0 comments on commit de75a5f

Please sign in to comment.