From 2a6005657e244a909bd05dca588fb6bea0cc9a27 Mon Sep 17 00:00:00 2001 From: Pavan Kumar Sunkara Date: Sat, 1 Feb 2020 06:49:24 +0100 Subject: [PATCH] Apply suggestions from code review Co-Authored-By: CreepySkeleton --- src/parse/errors.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/parse/errors.rs b/src/parse/errors.rs index b44d51da..6291d48b 100644 --- a/src/parse/errors.rs +++ b/src/parse/errors.rs @@ -985,7 +985,7 @@ impl Error { when: color, }); Error { - cause: format!("{}", e), + cause: e.to_string(), message: format!("{} {}", c.error("error:"), e), kind: ErrorKind::Io, info: None, @@ -1046,12 +1046,12 @@ impl Display for Error { impl From for Error { fn from(e: io::Error) -> Self { - Error::with_description(format!("{}", e), ErrorKind::Io) + Error::with_description(e.to_string(), ErrorKind::Io) } } impl From for Error { fn from(e: std_fmt::Error) -> Self { - Error::with_description(format!("{}", e), ErrorKind::Format) + Error::with_description(e.to_string(), ErrorKind::Format) } }