editor changes

This commit is contained in:
2025-06-16 03:49:08 +01:00
parent 7f834adbce
commit e9eca34d48
7 changed files with 52 additions and 17 deletions
+1
View File
@@ -16,6 +16,7 @@ impl From<RegisterParseError> for ArgsDecodeError {
fn from(value: RegisterParseError) -> Self {
match value {
RegisterParseError::InvalidIndex(idx) => Self::InvalidRegister(idx),
RegisterParseError::InvalidName(_) => Self::InvalidRegister(0xFF),
}
}
}
+2
View File
@@ -6,12 +6,14 @@ use crate::prelude::*;
/// Error type for parsing register numbers.
pub enum RegisterParseError {
InvalidIndex(u8),
InvalidName(String),
}
impl std::fmt::Display for RegisterParseError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::InvalidIndex(idx) => write!(f, "invalid index given ({idx})"),
Self::InvalidName(name) => write!(f, "invalid name given ({name})"),
}
}
}