From 5f9e0b46b22477c9c5317e28230935fa3a08fb60 Mon Sep 17 00:00:00 2001 From: Temirkhan Myrzamadi Date: Sat, 4 Jul 2020 00:33:35 +0600 Subject: [PATCH] Fix impl Error for ParseError --- src/utils/command.rs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/utils/command.rs b/src/utils/command.rs index 655366ff..141e65b3 100644 --- a/src/utils/command.rs +++ b/src/utils/command.rs @@ -228,11 +228,18 @@ pub enum ParseError { impl Display for ParseError { fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), std::fmt::Error> { match self { - ParseError::TooFewArguments { expected: _, found: _, message } => { - write!(f, "{}", message) - } - ParseError::TooManyArguments { expected: _, found: _, message } => { - write!(f, "{}", message) + ParseError::TooFewArguments { expected, found, message } => write!( + f, + "Too few arguments (expected {}, found {}, message = '{}')", + expected, found, message + ), + ParseError::TooManyArguments { expected, found, message } => { + write!( + f, + "Too many arguments (expected {}, found {}, message = \ + '{}')", + expected, found, message + ) } ParseError::IncorrectFormat(e) => { write!(f, "Incorrect format of command args: {}", e)