mirror of
git://git.proxmox.com/git/proxmox-backup.git
synced 2025-01-07 17:18:03 +03:00
api-types: make BackupType::iter an actual iterator
Otherwise we have to use BackupType::iter().iter() whenever we're not using a `for _ in iter()` construct. Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
5a2f7ea7cf
commit
6b46f25965
@ -741,8 +741,11 @@ impl BackupType {
|
||||
}
|
||||
}
|
||||
|
||||
pub const fn iter() -> &'static [BackupType] {
|
||||
&[Self::Vm, Self::Ct, Self::Host]
|
||||
#[inline]
|
||||
pub fn iter() -> impl Iterator<Item = BackupType> + Send + Sync + Unpin + 'static {
|
||||
[BackupType::Vm, BackupType::Ct, BackupType::Host]
|
||||
.iter()
|
||||
.copied()
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user