Skip to content

Commit

Permalink
fix: Separate all errors with a newline
Browse files Browse the repository at this point in the history
  • Loading branch information
Marwes committed Jul 1, 2017
1 parent 3fff91e commit 86f159f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions base/src/error.rs
Expand Up @@ -104,8 +104,14 @@ impl<'a, T> IntoIterator for &'a mut Errors<T> {

impl<T: fmt::Display> fmt::Display for Errors<T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
for error in &self.errors {
write!(f, "{}\n", error)?;
for (i, error) in self.errors.iter().enumerate() {
write!(f, "{}", error)?;
// Errors are assumed to not have a newline at the end so we add one to keep errors on
// separate lines and one to space them out
if i + 1 != self.errors.len() {
writeln!(f)?;
writeln!(f)?;
}
}
Ok(())
}
Expand Down

0 comments on commit 86f159f

Please sign in to comment.