how.rs/examples/output.rs

23 lines
692 B
Rust
Raw Normal View History

2022-07-21 20:40:44 -04:00
use how::*;
fn main0() -> Result<()> {
Err(How::new(
"The engine broke down"
.with("Remember: you aren't good with cars")
.with("Suggestion: call a tow truck")
2023-07-03 18:44:28 -04:00
.with("Foo".with("Bar").with("Baz"))
.with("Foo\nBar"),
)
.context(
"While driving down a road"
.with(format!("Where the road is {}", "Main Street"))
.with(format!("And the speed is {}", "86 km/h")),
)
.context("While driving to a location".with(format!("Where the location is {}", "the Mall")))
.context(format!("While in the car with {:?}", ["Mom", "Dad"])))?
2022-07-21 20:40:44 -04:00
}
fn main() -> TerminationResult {
main0().into()
}