From 1647fc93ff5d5fecb273fe3b45f312f3cbaaa849 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Thu, 14 Jul 2022 11:09:34 +0200 Subject: [PATCH] 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 --- pbs-api-types/src/datastore.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pbs-api-types/src/datastore.rs b/pbs-api-types/src/datastore.rs index 70b639ea..170d248f 100644 --- a/pbs-api-types/src/datastore.rs +++ b/pbs-api-types/src/datastore.rs @@ -741,8 +741,11 @@ impl BackupType { } } - pub const fn iter() -> &'static [BackupType] { - &[Self::Vm, Self::Ct, Self::Host] + #[inline] + pub fn iter() -> impl Iterator + Send + Sync + Unpin + 'static { + [BackupType::Vm, BackupType::Ct, BackupType::Host] + .iter() + .copied() } }