diff --git a/vtparse/src/lib.rs b/vtparse/src/lib.rs index 8f4483b91..5a1115f49 100644 --- a/vtparse/src/lib.rs +++ b/vtparse/src/lib.rs @@ -397,12 +397,21 @@ pub struct VTParser { /// and I are intermediate bytes in the range 0x20-0x2F /// and F is the final byte in the range 0x40-0x7E /// -#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)] +#[derive(Copy, Clone, PartialEq, Eq, Hash)] pub enum CsiParam { Integer(i64), P(u8), } +impl core::fmt::Debug for CsiParam { + fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result { + match self { + Self::Integer(i) => write!(fmt, "Integer({i})"), + Self::P(n) => write!(fmt, "P({})", char::from(*n)), + } + } +} + impl Default for CsiParam { fn default() -> Self { Self::Integer(0)