docs: fix minor doc issues with error stuff

This commit is contained in:
Kat Marchán 2022-04-23 02:20:40 -07:00
parent 177c42cae7
commit c2cdc5de37
No known key found for this signature in database
GPG Key ID: AEB529C08A3C7E9E
4 changed files with 25 additions and 5 deletions

View File

@ -66,10 +66,17 @@ assert_eq!(&doc.to_string(), node_str);
[`KdlDocument`], [`KdlNode`], [`KdlEntry`], and [`KdlIdentifier`] can all
be parsed and managed this way.
### Error Reporting
This error implements [`miette::Diagnostic`] and can be used to display
[`KdlError`] implements [`miette::Diagnostic`] and can be used to display
detailed, pretty-printed diagnostic messages when using [`miette::Result`]
and the `"pretty"` feature flag for `miette`:
and the `"fancy"` feature flag for `miette`:
```toml
# Cargo.toml
[dependencies]
miette = { version = "x.y.z", features = ["fancy"] }
```
```rust
fn main() -> miette::Result<()> {
@ -98,3 +105,6 @@ License](LICENSE.md).
[`KdlNode`]: https://docs.rs/kdl/3.0.1-alpha.0/kdl/struct.KdlNode.html
[`KdlEntry`]: https://docs.rs/kdl/3.0.1-alpha.0/kdl/struct.KdlEntry.html
[`KdlIdentifier`]: https://docs.rs/kdl/3.0.1-alpha.0/kdl/struct.KdlIdentifier.html
[`KdlError`]: https://docs.rs/kdl/3.0.1-alpha.0/kdl/struct.KdlError.html
[`miette::Diagnostic`]: https://docs.rs/miette/latest/miette/trait.Diagnostic.html
[`miette::Result`]: https://docs.rs/miette/latest/miette/type.Result.html

View File

@ -6,3 +6,6 @@
[`KdlNode`]: https://docs.rs/kdl/{{version}}/kdl/struct.KdlNode.html
[`KdlEntry`]: https://docs.rs/kdl/{{version}}/kdl/struct.KdlEntry.html
[`KdlIdentifier`]: https://docs.rs/kdl/{{version}}/kdl/struct.KdlIdentifier.html
[`KdlError`]: https://docs.rs/kdl/{{version}}/kdl/struct.KdlError.html
[`miette::Diagnostic`]: https://docs.rs/miette/latest/miette/trait.Diagnostic.html
[`miette::Result`]: https://docs.rs/miette/latest/miette/type.Result.html

View File

@ -14,7 +14,7 @@ use {
///
/// This error implements [`miette::Diagnostic`] and can be used to display
/// detailed, pretty-printed diagnostic messages when using [`miette::Result`]
/// and the `"pretty"` feature flag for `miette`:
/// and the `"fancy"` feature flag for `miette`:
///
/// ```no_run
/// fn main() -> miette::Result<()> {

View File

@ -64,10 +64,17 @@
//! [`KdlDocument`], [`KdlNode`], [`KdlEntry`], and [`KdlIdentifier`] can all
//! be parsed and managed this way.
//!
//! ## Error Reporting
//!
//! This error implements [`miette::Diagnostic`] and can be used to display
//! [`KdlError`] implements [`miette::Diagnostic`] and can be used to display
//! detailed, pretty-printed diagnostic messages when using [`miette::Result`]
//! and the `"pretty"` feature flag for `miette`:
//! and the `"fancy"` feature flag for `miette`:
//!
//! ```toml
//! # Cargo.toml
//! [dependencies]
//! miette = { version = "x.y.z", features = ["fancy"] }
//! ```
//!
//! ```no_run
//! fn main() -> miette::Result<()> {