implements Debug for ControlFunctionType

This commit is contained in:
Frank Zechert 2023-04-01 01:10:51 +02:00
parent 2791de95c9
commit 04e6baf31d

View File

@ -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,