This commit is contained in:
ripytide
2023-03-31 18:07:15 +01:00
parent 206ebebdc8
commit 05b5289436
2 changed files with 0 additions and 99 deletions
-50
View File
@@ -1738,56 +1738,6 @@ where
}
}
impl<const N: usize, I, K, V> TryFrom<[(K, V); N]> for RangeBoundsMap<I, K, V>
where
K: RangeBounds<I>,
I: Ord + Clone,
{
type Error = OverlapError;
#[trivial]
fn try_from(pairs: [(K, V); N]) -> Result<Self, Self::Error> {
let mut range_bounds_map = RangeBoundsMap::new();
for (range_bounds, value) in pairs {
range_bounds_map.insert_strict(range_bounds, value)?;
}
return Ok(range_bounds_map);
}
}
impl<I, K, V> TryFrom<Vec<(K, V)>> for RangeBoundsMap<I, K, V>
where
K: RangeBounds<I>,
I: Ord + Clone,
{
type Error = OverlapError;
#[trivial]
fn try_from(pairs: Vec<(K, V)>) -> Result<Self, Self::Error> {
let mut range_bounds_map = RangeBoundsMap::new();
for (range_bounds, value) in pairs {
range_bounds_map.insert_strict(range_bounds, value)?;
}
return Ok(range_bounds_map);
}
}
impl<I, K, V> FromIterator<(K, V)> for RangeBoundsMap<I, K, V>
where
K: RangeBounds<I>,
I: Ord + Clone,
{
#[trivial]
fn from_iter<T: IntoIterator<Item = (K, V)>>(iter: T) -> Self {
let mut output = RangeBoundsMap::new();
for (range_bounds, value) in iter {
output.insert_strict(range_bounds, value).unwrap();
}
return output;
}
}
impl<I, K, V> IntoIterator for RangeBoundsMap<I, K, V>
where
K: RangeBounds<I>,
-49
View File
@@ -1016,55 +1016,6 @@ where
}
}
impl<const N: usize, I, K> TryFrom<[K; N]> for RangeBoundsSet<I, K>
where
K: RangeBounds<I>,
I: Ord + Clone,
{
type Error = OverlapError;
#[trivial]
fn try_from(pairs: [K; N]) -> Result<Self, Self::Error> {
let mut range_bounds_set = RangeBoundsSet::new();
for range_bounds in pairs {
range_bounds_set.insert_strict(range_bounds)?;
}
return Ok(range_bounds_set);
}
}
impl<I, K> TryFrom<Vec<K>> for RangeBoundsSet<I, K>
where
K: RangeBounds<I>,
I: Ord + Clone,
{
type Error = OverlapError;
#[trivial]
fn try_from(pairs: Vec<K>) -> Result<Self, Self::Error> {
let mut range_bounds_set = RangeBoundsSet::new();
for range_bounds in pairs {
range_bounds_set.insert_strict(range_bounds)?;
}
return Ok(range_bounds_set);
}
}
impl<I, K> FromIterator<K> for RangeBoundsSet<I, K>
where
K: RangeBounds<I>,
I: Ord + Clone,
{
#[trivial]
fn from_iter<T: IntoIterator<Item = K>>(iter: T) -> Self {
let mut output = RangeBoundsSet::new();
for range_bounds in iter {
output.insert_strict(range_bounds).unwrap();
}
return output;
}
}
impl<I, K> IntoIterator for RangeBoundsSet<I, K>
where
K: RangeBounds<I>,