refactor(meta-command): have execute be a member function

This commit is contained in:
Khaïs COLIN 2025-05-02 20:46:08 +02:00
parent ee23572983
commit 711d51090e
2 changed files with 15 additions and 4 deletions

View file

@ -2,6 +2,18 @@ pub enum MetaCommand {
Exit,
}
pub struct MetaCommandExecuteResult {
pub should_exit: bool,
}
impl MetaCommand {
pub fn execute(&self) -> MetaCommandExecuteResult {
match self {
MetaCommand::Exit => MetaCommandExecuteResult { should_exit: true },
}
}
}
pub enum MetaCommandParseError {
Unrecognized { cmd: String },
}