schema: impl FromIterator for ParameterError

for where we also have Extend impls

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2022-02-14 09:46:18 +01:00
parent 706d966c87
commit c43ac0a64c

View File

@ -121,6 +121,28 @@ impl IntoIterator for ParameterError {
}
}
impl FromIterator<(String, Error)> for ParameterError {
fn from_iter<T>(iter: T) -> Self
where
T: IntoIterator<Item = (String, Error)>,
{
let mut this = Self::new();
this.extend(iter);
this
}
}
impl FromIterator<(&str, Error)> for ParameterError {
fn from_iter<T>(iter: T) -> Self
where
T: IntoIterator<Item = (String, Error)>,
{
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))]