diff --git a/README.md b/README.md index 1d0d0a5..dc5adcd 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/README.tpl b/README.tpl index f71c41b..56edb29 100644 --- a/README.tpl +++ b/README.tpl @@ -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 diff --git a/src/error.rs b/src/error.rs index e9f145a..bd1d287 100644 --- a/src/error.rs +++ b/src/error.rs @@ -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<()> { diff --git a/src/lib.rs b/src/lib.rs index 4dadb9b..89d25ca 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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<()> {