Adjust formatting
This commit is contained in:
parent
60b4547267
commit
ae7281abac
3 changed files with 4 additions and 4 deletions
|
@ -5,7 +5,8 @@ fn main0() -> Result<()> {
|
|||
"The engine broke down"
|
||||
.with("Remember: you aren't good with cars")
|
||||
.with("Suggestion: call a tow truck")
|
||||
.with("Foo".with("Bar").with("Baz")),
|
||||
.with("Foo".with("Bar").with("Baz"))
|
||||
.with("Foo\nBar"),
|
||||
)
|
||||
.context(
|
||||
"While driving down a road"
|
||||
|
|
|
@ -58,7 +58,7 @@ impl fmt::Display for Context {
|
|||
let opts = ReportOpts::default();
|
||||
for detail in &self.extra {
|
||||
f.write_str("\n")?;
|
||||
report_write!(f, &opts.indent().next(), "- {detail}")?;
|
||||
report_write!(f, &opts.indent().indent().next(), " - {detail}")?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
@ -140,12 +140,11 @@ impl std::error::Error for How {}
|
|||
|
||||
impl std::fmt::Display for How {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
let opts = ReportOpts::default();
|
||||
for (i, ctx) in self.0.context.iter().enumerate() {
|
||||
if i != 0 {
|
||||
f.write_str("\n")?;
|
||||
}
|
||||
report_write!(f, &opts.indent().next(), "{ctx}")?;
|
||||
std::fmt::Display::fmt(ctx, f)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue