Rather than storing inside Command the command's character as code, represent each command as an enum.
So the existing:
pub struct Command {
pub code: char, // Command code
pub addr1: Option<Address>, // Start address
will become
// Sed commands derived from single-character command codes
pub enum Command {
Append, // a
Branch, // b
Change, // c
// …
}
pub struct CommandDetails {
pub command: Command, // Command to perform
pub addr1: Option<Address>, // Start address
Rather than storing inside
Commandthe command's character ascode, represent each command as anenum.So the existing:
will become