mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-08 12:35:41 +00:00
Merge pull request #188 from figsoda/remove-trailing-blank-line
remove trailing blank lines in error messages
This commit is contained in:
commit
6fd0579822
@ -49,11 +49,11 @@ pub struct FinalError {
|
|||||||
impl Display for FinalError {
|
impl Display for FinalError {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
// Title
|
// Title
|
||||||
writeln!(f, "{}[ERROR]{} {}", *RED, *RESET, self.title)?;
|
write!(f, "{}[ERROR]{} {}", *RED, *RESET, self.title)?;
|
||||||
|
|
||||||
// Details
|
// Details
|
||||||
for detail in &self.details {
|
for detail in &self.details {
|
||||||
writeln!(f, " {}-{} {}", *WHITE, *YELLOW, detail)?;
|
write!(f, "\n - {}{}{}", *YELLOW, detail, *RESET)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hints
|
// Hints
|
||||||
@ -61,11 +61,11 @@ impl Display for FinalError {
|
|||||||
// Separate by one blank line.
|
// Separate by one blank line.
|
||||||
writeln!(f)?;
|
writeln!(f)?;
|
||||||
for hint in &self.hints {
|
for hint in &self.hints {
|
||||||
writeln!(f, "{}hint:{} {}", *GREEN, *RESET, hint)?;
|
write!(f, "\n{}hint:{} {}", *GREEN, *RESET, hint)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
write!(f, "{}", *RESET)
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user