mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-19 21:49:00 +01:00
Fix impl Error for ParseError
This commit is contained in:
parent
82439c2a4c
commit
5f9e0b46b2
1 changed files with 12 additions and 5 deletions
|
@ -228,11 +228,18 @@ pub enum ParseError {
|
||||||
impl Display for ParseError {
|
impl Display for ParseError {
|
||||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), std::fmt::Error> {
|
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), std::fmt::Error> {
|
||||||
match self {
|
match self {
|
||||||
ParseError::TooFewArguments { expected: _, found: _, message } => {
|
ParseError::TooFewArguments { expected, found, message } => write!(
|
||||||
write!(f, "{}", message)
|
f,
|
||||||
}
|
"Too few arguments (expected {}, found {}, message = '{}')",
|
||||||
ParseError::TooManyArguments { expected: _, found: _, message } => {
|
expected, found, message
|
||||||
write!(f, "{}", message)
|
),
|
||||||
|
ParseError::TooManyArguments { expected, found, message } => {
|
||||||
|
write!(
|
||||||
|
f,
|
||||||
|
"Too many arguments (expected {}, found {}, message = \
|
||||||
|
'{}')",
|
||||||
|
expected, found, message
|
||||||
|
)
|
||||||
}
|
}
|
||||||
ParseError::IncorrectFormat(e) => {
|
ParseError::IncorrectFormat(e) => {
|
||||||
write!(f, "Incorrect format of command args: {}", e)
|
write!(f, "Incorrect format of command args: {}", e)
|
||||||
|
|
Loading…
Add table
Reference in a new issue