From 6caa87415efb27707b5c3f7fe282bc72aa2c5ef4 Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 17 Aug 2026 13:33:57 +0200 Subject: fix(engine-ecs): exclude empty items in ArrayVec Debug fmt output --- engine-ecs/src/util/array_vec.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'engine-ecs/src') diff --git a/engine-ecs/src/util/array_vec.rs b/engine-ecs/src/util/array_vec.rs index 5863507..3e3344c 100644 --- a/engine-ecs/src/util/array_vec.rs +++ b/engine-ecs/src/util/array_vec.rs @@ -1,7 +1,7 @@ +use std::fmt::Debug; use std::mem::MaybeUninit; use std::ops::{Deref, DerefMut}; -#[derive(Debug)] pub struct ArrayVec { items: [MaybeUninit; CAPACITY], @@ -153,3 +153,15 @@ impl Drop for ArrayVec } } } + +impl Debug for ArrayVec +{ + fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result + { + formatter + .debug_struct("ArrayVec") + .field("items", &self.as_ref()) + .field("len", &self.len) + .finish() + } +} -- cgit v1.2.3-18-g5258