mirror of https://github.com/zkat/miette.git
docs: fix doctests
This commit is contained in:
parent
c337e2759f
commit
bb25edf019
12
README.md
12
README.md
|
|
@ -371,7 +371,7 @@ use thiserror::Error;
|
||||||
#[error("oops")]
|
#[error("oops")]
|
||||||
struct MyError {
|
struct MyError {
|
||||||
#[related]
|
#[related]
|
||||||
Vec<MyError>,
|
others: Vec<MyError>,
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -384,13 +384,15 @@ of falling back to your own custom handler.
|
||||||
Usage is like so:
|
Usage is like so:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
miette::set_hook(|_| {
|
miette::set_hook(Box::new(|_| {
|
||||||
MietteHandlerOpts::new()
|
Box::new(miette::MietteHandlerOpts::new()
|
||||||
.terminal_links(true)
|
.terminal_links(true)
|
||||||
.unicode(false)
|
.unicode(false)
|
||||||
.context_lines(3)
|
.context_lines(3)
|
||||||
.build()
|
.build())
|
||||||
})
|
}))
|
||||||
|
|
||||||
|
# .unwrap()
|
||||||
```
|
```
|
||||||
|
|
||||||
See the docs for [MietteHandlerOptions] for more details on what you can customize!
|
See the docs for [MietteHandlerOptions] for more details on what you can customize!
|
||||||
|
|
|
||||||
|
|
@ -16,13 +16,14 @@ Create a custom [MietteHandler] from options.
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
```no_run
|
```no_run
|
||||||
miette::set_hook(|_| {
|
miette::set_hook(Box::new(|_| {
|
||||||
MietteHandlerOpts::new()
|
Box::new(miette::MietteHandlerOpts::new()
|
||||||
.terminal_links(true)
|
.terminal_links(true)
|
||||||
.unicode(false)
|
.unicode(false)
|
||||||
.context_lines(3)
|
.context_lines(3)
|
||||||
.build()
|
.build())
|
||||||
})
|
}))
|
||||||
|
# .unwrap();
|
||||||
```
|
```
|
||||||
*/
|
*/
|
||||||
#[derive(Default, Debug, Clone)]
|
#[derive(Default, Debug, Clone)]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue