improvements and fixes

This commit is contained in:
elvis
2025-10-27 14:39:11 +01:00
parent 462d0e9d53
commit fbc767a21b
6 changed files with 252 additions and 54 deletions

View File

@ -430,7 +430,7 @@ impl<'a> IntoIterator for &'a Environment {
impl<const N: usize> From<[(IdType, Process); N]> for Environment {
fn from(arr: [(IdType, Process); N]) -> Self {
Environment {
Self {
definitions: BTreeMap::from(arr),
}
}
@ -438,7 +438,7 @@ impl<const N: usize> From<[(IdType, Process); N]> for Environment {
impl From<&[(IdType, Process)]> for Environment {
fn from(arr: &[(IdType, Process)]) -> Self {
Environment {
Self {
definitions: BTreeMap::from_iter(arr.to_vec()),
}
}
@ -446,7 +446,7 @@ impl From<&[(IdType, Process)]> for Environment {
impl From<Vec<(IdType, Process)>> for Environment {
fn from(arr: Vec<(IdType, Process)>) -> Self {
Environment {
Self {
definitions: BTreeMap::from_iter(arr),
}
}
@ -812,3 +812,28 @@ impl From<Environment> for PositiveEnvironment {
(&value).into()
}
}
impl<const N: usize> From<[(IdType, PositiveProcess); N]> for PositiveEnvironment {
fn from(arr: [(IdType, PositiveProcess); N]) -> Self {
Self {
definitions: BTreeMap::from(arr),
}
}
}
impl From<&[(IdType, PositiveProcess)]> for PositiveEnvironment {
fn from(arr: &[(IdType, PositiveProcess)]) -> Self {
Self {
definitions: BTreeMap::from_iter(arr.to_vec()),
}
}
}
impl From<Vec<(IdType, PositiveProcess)>> for PositiveEnvironment {
fn from(arr: Vec<(IdType, PositiveProcess)>) -> Self {
Self {
definitions: BTreeMap::from_iter(arr),
}
}
}