summaryrefslogtreecommitdiff
path: root/engine-ecs/src/util.rs
diff options
context:
space:
mode:
Diffstat (limited to 'engine-ecs/src/util.rs')
-rw-r--r--engine-ecs/src/util.rs59
1 files changed, 0 insertions, 59 deletions
diff --git a/engine-ecs/src/util.rs b/engine-ecs/src/util.rs
index 304ba21..f3498fa 100644
--- a/engine-ecs/src/util.rs
+++ b/engine-ecs/src/util.rs
@@ -1,4 +1,3 @@
-use std::fmt::Display;
use std::hash::Hash;
use std::mem::transmute;
use std::ops::{BitAnd, Deref};
@@ -132,64 +131,6 @@ impl<Value> Deref for BorrowedOrOwned<'_, Value>
}
}
-#[derive(Debug, Clone)]
-pub enum Either<A, B>
-{
- A(A),
- B(B),
-}
-
-impl<A, B> Either<A, B>
-{
- #[inline]
- pub fn as_a(&self) -> Option<&A>
- {
- match self {
- Self::A(a) => Some(a),
- Self::B(_) => None,
- }
- }
-
- #[inline]
- pub fn as_b(&self) -> Option<&B>
- {
- match self {
- Self::A(_) => None,
- Self::B(b) => Some(b),
- }
- }
-}
-
-impl<A, B> Iterator for Either<A, B>
-where
- A: Iterator,
- B: Iterator<Item = A::Item>,
-{
- type Item = A::Item;
-
- fn next(&mut self) -> Option<Self::Item>
- {
- match self {
- Self::A(a) => a.next(),
- Self::B(b) => b.next(),
- }
- }
-}
-
-impl<A, B> Display for Either<A, B>
-where
- A: Display,
- B: Display,
-{
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result
- {
- match self {
- Self::A(a) => a.fmt(f),
- Self::B(b) => b.fmt(f),
- }
- }
-}
-
pub trait HashMapExt<Key, Value>
{
/// Returns true if the keys are a subset of another [`HashMap`]'s keys, i.e., `other`