From 0a4cf4ad24eb668d6668400b9ab3e8c896b33e3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kat=20March=C3=A1n?= Date: Thu, 5 May 2022 12:44:49 -0700 Subject: [PATCH] fix(tests): add Display impl to diagnostic_source example --- README.md | 1 - src/lib.rs | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index eb6869c..bc905fd 100644 --- a/README.md +++ b/README.md @@ -385,7 +385,6 @@ pub struct MyErrorType { [`miette!`]: https://docs.rs/miette/latest/miette/macro.miette.html [`std::error::Error`]: https://doc.rust-lang.org/nightly/std/error/trait.Error.html -[`std::error::Error::source`]: https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.source [`Diagnostic`]: https://docs.rs/miette/latest/miette/struct.Diagnostic.html [`IntoDiagnostic`]: https://docs.rs/miette/latest/miette/trait.IntoDiagnostic.html [`MietteHandlerOpts`]: https://docs.rs/miette/latest/miette/struct.MietteHandlerOpts.html diff --git a/src/lib.rs b/src/lib.rs index a79700a..8c68a4c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -539,6 +539,7 @@ //! use thiserror::Error; //! //! #[derive(Debug, Diagnostic, Error)] +//! #[error("MyError")] //! struct MyError { //! #[source] //! #[diagnostic_source] @@ -546,6 +547,7 @@ //! } //! //! #[derive(Debug, Diagnostic, Error)] +//! #[error("OtherError")] //! struct OtherError; //! ``` //!