Skip to content
Myr

Pull in thiserror library for tests

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Tolnay · committed by David Tolnay · parent d4bc68c · Browse files · 3 files+11 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+11 added−6 removed

  • other:+11 added−6 removed

3 files+11 added−6 removed

modified:src/lib.rs+4 added-4 removed
130 unmodified lines
131//!132//! [thiserror]: https://github.com/dtolnay/thiserror133//!134//! ```135//! # const IGNORE: &str = stringify! {135//! use thiserror::Error;136//!137//! #[derive(Error, Debug)]138//! pub enum FormatError {138//! #[error(display = "invalid header (expected {:?}, got {:?})", expected, found)]139//! #[error("invalid header (expected {expected:?}, got {found:?})")]140//! InvalidHeader {141//! expected: String,142//! found: String,143//! },143//! #[error(display = "missing attribute: {}", _0)]144//! #[error("missing attribute: {0}")]145//! MissingAttribute(String),146//! }146//! # };147//! ```148//!149//! - One-off error messages can be constructed using the `anyhow!` macro, which150//! supports string interpolation and produces an `anyhow::Error`.
282 unmodified lines
modified:Cargo.toml+3 added
modified:README.md+4 added-2 removed