refactoring

This commit is contained in:
p0lunin 2020-06-06 20:50:59 +03:00
parent 5f27eaf6d1
commit 5e276d65f4

View file

@ -194,6 +194,9 @@ pub trait BotCommand: Sized {
N: Into<String>; N: Into<String>;
} }
pub type PrefixedBotCommand = String;
pub type BotName = String;
/// Errors returned from [`BotCommand::parse`]. /// Errors returned from [`BotCommand::parse`].
/// ///
/// [`BotCommand::parse`]: crate::utils::command::BotCommand::parse /// [`BotCommand::parse`]: crate::utils::command::BotCommand::parse
@ -215,8 +218,8 @@ pub enum ParseError {
/// [`FromStr::from_str`]: https://doc.rust-lang.org/std/str/trait.FromStr.html#tymethod.from_str /// [`FromStr::from_str`]: https://doc.rust-lang.org/std/str/trait.FromStr.html#tymethod.from_str
IncorrectFormat, IncorrectFormat,
UnknownCommand(String), UnknownCommand(PrefixedBotCommand),
WrongBotName(String), WrongBotName(BotName),
/// A custom error which you can return from your custom parser. /// A custom error which you can return from your custom parser.
Custom(Box<dyn Error>), Custom(Box<dyn Error>),