mod builtin_errors; mod command_syntax_error; pub use builtin_errors::BuiltInError; pub use command_syntax_error::CommandSyntaxError; pub trait CommandResultTrait { fn new(i: i32) -> Self; fn as_i32(&self) -> Option; } impl CommandResultTrait for i32 { fn new(i: i32) -> Self { i } fn as_i32(&self) -> Option { Some(*self) } } impl CommandResultTrait for Result { fn new(i: i32) -> Self { Ok(i) } fn as_i32(&self) -> Option { self.as_ref().copied().ok() } }