mirror of
https://git.proxmox.com/git/proxmox-backup
synced 2025-08-06 15:37:41 +00:00
tape inventory: code cleanup media pool look-up
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
6905bd3735
commit
7792507a12
@ -249,14 +249,11 @@ impl Inventory {
|
||||
///
|
||||
/// Returns (pool, is_empty)
|
||||
pub fn lookup_media_pool(&self, uuid: &Uuid) -> Option<(&str, bool)> {
|
||||
match self.map.get(uuid) {
|
||||
None => None,
|
||||
Some(entry) => entry
|
||||
.id
|
||||
.media_set_label
|
||||
.as_ref()
|
||||
.map(|set| (set.pool.as_str(), set.unassigned())),
|
||||
}
|
||||
let pool = self.map.get(uuid)?;
|
||||
pool.id
|
||||
.media_set_label
|
||||
.as_ref()
|
||||
.map(|media_set| (media_set.pool.as_str(), media_set.unassigned()))
|
||||
}
|
||||
|
||||
/// List all media assigned to the pool
|
||||
|
Loading…
Reference in New Issue
Block a user