Fix: Off by one error
When printing the error chain, we print the error and then iterate over the causes. Hence, we have to increase the printed number by one here, because 0 (zero) is already printed. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
parent
2611583839
commit
dc162cb167
1 changed files with 1 additions and 1 deletions
|
@ -41,7 +41,7 @@ impl<'a> Display for ImagTrace<'a, Error>
|
|||
for (i, cause) in self.0.iter_causes().enumerate() {
|
||||
let _ = writeln!(fmt,
|
||||
"{prefix}: {error}",
|
||||
prefix = Red.blink().paint(format!("ERROR[{:>4}]", i)),
|
||||
prefix = Red.blink().paint(format!("ERROR[{:>4}]", i + 1)),
|
||||
error = cause)?;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue