Adjust formatting

This commit is contained in:
Michael Pfaff 2023-07-03 18:44:28 -04:00
parent 60b4547267
commit ae7281abac
Signed by: michael
GPG Key ID: CF402C4A012AA9D4
3 changed files with 4 additions and 4 deletions

View File

@ -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"

View File

@ -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(())
}

View File

@ -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(())
}