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