Skip to content

Commit

Permalink
Merge pull request #188 from figsoda/remove-trailing-blank-line
Browse files Browse the repository at this point in the history
remove trailing blank lines in error messages
  • Loading branch information
marcospb19 committed Nov 11, 2021
2 parents 9ad8ca7 + 5616231 commit 6fd0579
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,23 @@ pub struct FinalError {
impl Display for FinalError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
// Title
writeln!(f, "{}[ERROR]{} {}", *RED, *RESET, self.title)?;
write!(f, "{}[ERROR]{} {}", *RED, *RESET, self.title)?;

// Details
for detail in &self.details {
writeln!(f, " {}-{} {}", *WHITE, *YELLOW, detail)?;
write!(f, "\n - {}{}{}", *YELLOW, detail, *RESET)?;
}

// Hints
if !self.hints.is_empty() {
// Separate by one blank line.
writeln!(f)?;
for hint in &self.hints {
writeln!(f, "{}hint:{} {}", *GREEN, *RESET, hint)?;
write!(f, "\n{}hint:{} {}", *GREEN, *RESET, hint)?;
}
}

write!(f, "{}", *RESET)
Ok(())
}
}

Expand Down

0 comments on commit 6fd0579

Please sign in to comment.