From 04e6baf31d636d3d46d8f50c23d8c61f95e90322 Mon Sep 17 00:00:00 2001 From: Frank Zechert Date: Sat, 1 Apr 2023 01:10:51 +0200 Subject: [PATCH] implements Debug for ControlFunctionType --- src/lib.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 5afeccd..37fac8d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -109,7 +109,20 @@ enum ControlFunctionType { ControlString, } -/// A control function. +impl fmt::Debug for ControlFunctionType { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match self { + ControlFunctionType::C0 => write!(f, "C0"), + ControlFunctionType::C1 => write!(f, "C1"), + ControlFunctionType::ControlSequence => write!(f, "Control Sequence"), + ControlFunctionType::IndependentControlFunction => { + write!(f, "Independent Control Function") + } + ControlFunctionType::ControlString => write!(f, "Control String"), + } + } +} + pub struct ControlFunction { function_type: ControlFunctionType, value: &'static str,