mirror of
https://github.com/dtolnay/thiserror.git
synced 2025-04-06 22:37:38 +03:00
13 lines
238 B
Rust
13 lines
238 B
Rust
use thiserror::Error;
|
|
|
|
macro_rules! error_type {
|
|
($name:ident, $what:expr) => {
|
|
#[derive(Error, Debug)]
|
|
#[error(concat!("invalid ", $what))]
|
|
pub struct $name;
|
|
};
|
|
}
|
|
|
|
error_type!(Error, "foo");
|
|
|
|
fn main() {}
|