summaryrefslogtreecommitdiff
path: root/engine/src/util.rs
diff options
context:
space:
mode:
Diffstat (limited to 'engine/src/util.rs')
-rw-r--r--engine/src/util.rs45
1 files changed, 1 insertions, 44 deletions
diff --git a/engine/src/util.rs b/engine/src/util.rs
index a7caa2a..f016ad3 100644
--- a/engine/src/util.rs
+++ b/engine/src/util.rs
@@ -1,4 +1,4 @@
-use std::fmt::{Debug, Display};
+use std::fmt::Debug;
use crate::ecs::util::StreamingIterator;
@@ -28,49 +28,6 @@ impl<T> OptionExt<T> for Option<T>
}
}
-pub struct DisplaySlice<'a, Item>
-{
- slice: &'a [Item],
-}
-
-impl<'a, Item> DisplaySlice<'a, Item>
-{
- pub fn new(slice: &'a [Item]) -> Self
- {
- Self { slice }
- }
-}
-
-impl<Item> Display for DisplaySlice<'_, Item>
-where
- Item: Display,
-{
- fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result
- {
- let Some(first_item) = self.slice.first() else {
- return formatter.write_str("<empty>");
- };
-
- write!(formatter, "{first_item}")?;
-
- if self.slice.len() == 1 {
- return Ok(());
- }
-
- for item in &self.slice[1..self.slice.len() - 1] {
- write!(formatter, ", {item}")?;
- }
-
- let Some(last_item) = self.slice.last() else {
- unreachable!();
- };
-
- write!(formatter, " & {last_item}")?;
-
- Ok(())
- }
-}
-
#[derive(Debug)]
pub struct BitArray<const SIZE: usize, const BITS_PER_ITEM: usize>
{