Merge pull request #1305 from matthiasbeyer/libimagerror/writeln-fix

Use writeln!() instead of write!()
This commit is contained in:
Matthias Beyer 2018-02-20 20:13:40 +01:00 committed by GitHub
commit 944b81195b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -36,10 +36,10 @@ impl<'a, T> Display for ImagTrace<'a, T>
where T: ChainedError where T: ChainedError
{ {
fn fmt(&self, fmt: &mut Formatter) -> FmtResult { fn fmt(&self, fmt: &mut Formatter) -> FmtResult {
try!(write!(fmt, "{}: {}", Red.blink().paint("ERROR[ 0]"), self.0)); try!(writeln!(fmt, "{}: {}", Red.blink().paint("ERROR[ 0]"), self.0));
for (i, e) in self.0.iter().enumerate().skip(1) { for (i, e) in self.0.iter().enumerate().skip(1) {
try!(write!(fmt, "{}: {}", Red.blink().paint(format!("ERROR[{:>4}]", i)), e)); try!(writeln!(fmt, "{}: {}", Red.blink().paint(format!("ERROR[{:>4}]", i)), e));
} }
if let Some(backtrace) = self.0.backtrace() { if let Some(backtrace) = self.0.backtrace() {