From c43ac0a64c4850a0a8c8c08c554f1490e9882d2b Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Mon, 14 Feb 2022 09:46:18 +0100 Subject: [PATCH] schema: impl FromIterator for ParameterError for where we also have Extend impls Signed-off-by: Wolfgang Bumiller --- proxmox-schema/src/schema.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/proxmox-schema/src/schema.rs b/proxmox-schema/src/schema.rs index d90f44a3..d073f369 100644 --- a/proxmox-schema/src/schema.rs +++ b/proxmox-schema/src/schema.rs @@ -121,6 +121,28 @@ impl IntoIterator for ParameterError { } } +impl FromIterator<(String, Error)> for ParameterError { + fn from_iter(iter: T) -> Self + where + T: IntoIterator, + { + let mut this = Self::new(); + this.extend(iter); + this + } +} + +impl FromIterator<(&str, Error)> for ParameterError { + fn from_iter(iter: T) -> Self + where + T: IntoIterator, + { + let mut this = Self::new(); + this.extend(iter); + this + } +} + /// Data type to describe boolean values #[derive(Debug)] #[cfg_attr(feature = "test-harness", derive(Eq, PartialEq))]