prae
prae copied to clipboard
New macro syntax
I noticed that the current implementation of define!
and extend!
macros are incompatible with rustfmt
. Therefore, I propose the following new design:
define!({
#[derive(Debug)]
pub struct Text(String);
adjust(|t| *t = t.trim().to_owned());
ensure(|t| !t.is_empty());
plugins([prae::plugins::impl_serde, async_graphql::scalar]);
});
This looks more like a normal Rust code and is compatible with rustfmt
.