melib/error: don't print details if it's an empty string.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>pull/333/head
parent
ce4ba06ce9
commit
ab1b946fd9
|
@ -515,7 +515,9 @@ impl std::fmt::Display for Error {
|
|||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
write!(f, "{}", self.summary)?;
|
||||
if let Some(details) = self.details.as_ref() {
|
||||
write!(f, "\n{}", details)?;
|
||||
if !details.trim().is_empty() {
|
||||
write!(f, "\n{}", details)?;
|
||||
}
|
||||
}
|
||||
if let Some(source) = self.source.as_ref() {
|
||||
write!(f, "\nCaused by: {}", source)?;
|
||||
|
|
Loading…
Reference in New Issue