docs: fix doctests

This commit is contained in:
Kat Marchán 2021-09-26 13:00:39 -07:00
parent c337e2759f
commit bb25edf019
No known key found for this signature in database
GPG Key ID: AEB529C08A3C7E9E
2 changed files with 12 additions and 9 deletions

View File

@ -371,7 +371,7 @@ use thiserror::Error;
#[error("oops")]
struct MyError {
#[related]
Vec<MyError>,
others: Vec<MyError>,
}
```
@ -384,13 +384,15 @@ of falling back to your own custom handler.
Usage is like so:
```rust
miette::set_hook(|_| {
MietteHandlerOpts::new()
miette::set_hook(Box::new(|_| {
Box::new(miette::MietteHandlerOpts::new()
.terminal_links(true)
.unicode(false)
.context_lines(3)
.build()
})
.build())
}))
# .unwrap()
```
See the docs for [MietteHandlerOptions] for more details on what you can customize!

View File

@ -16,13 +16,14 @@ Create a custom [MietteHandler] from options.
## Example
```no_run
miette::set_hook(|_| {
MietteHandlerOpts::new()
miette::set_hook(Box::new(|_| {
Box::new(miette::MietteHandlerOpts::new()
.terminal_links(true)
.unicode(false)
.context_lines(3)
.build()
})
.build())
}))
# .unwrap();
```
*/
#[derive(Default, Debug, Clone)]