Skip to content
Myr

Touch up Debug impl for Error

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Tolnay · committed by David Tolnay · parent 951418f · Browse files · 1 file+3 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−5 removed

  • other:+3 added−5 removed

1 file+3 added−5 removed

modified:src/error.rs+3 added-5 removed
186 unmodified lines
187impl Debug for Error {188 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {189 writeln!(f, "{}", self.inner.error())?;190191 let mut errors = self.chain().skip(1).enumerate();192193 if let Some((n, error)) = errors.next() {191 let mut chain = self.chain().skip(1).enumerate();192 if let Some((n, error)) = chain.next() {193 writeln!(f, "\ncaused by:")?;194 writeln!(f, "\t{}: {}", n, error)?;196 for (n, error) in errors {195 for (n, error) in chain {196 writeln!(f, "\t{}: {}", n, error)?;197 }198 }199200 let backtrace = self.backtrace();202201 match backtrace.status() {202 BacktraceStatus::Captured => {203 writeln!(f, "\n{}", backtrace)?;204 }
155 unmodified lines