5
0
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:
Wolfgang Bumiller 2022-07-14 11:09:34 +02:00
parent 5a2f7ea7cf
commit 6b46f25965

View File

@ -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()
}
}