vtparse: improve CsiParam Debug impl
show the byte as a char
This commit is contained in:
1 file changed
+10
-1
+10
-1
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user