azalea_brigadier/errors/
mod.rs1mod builtin_errors;
2mod command_syntax_error;
3
4pub use builtin_errors::BuiltInError;
5pub use command_syntax_error::CommandSyntaxError;
6
7pub trait CommandResultTrait {
8 fn new(i: i32) -> Self;
9 fn as_i32(&self) -> Option<i32>;
10}
11impl CommandResultTrait for i32 {
12 fn new(i: i32) -> Self {
13 i
14 }
15 fn as_i32(&self) -> Option<i32> {
16 Some(*self)
17 }
18}
19impl<E> CommandResultTrait for Result<i32, E> {
20 fn new(i: i32) -> Self {
21 Ok(i)
22 }
23 fn as_i32(&self) -> Option<i32> {
24 self.as_ref().copied().ok()
25 }
26}