prae icon indicating copy to clipboard operation
prae copied to clipboard

New macro syntax

Open teenjuna opened this issue 1 year ago • 0 comments

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.

teenjuna avatar Dec 19 '23 18:12 teenjuna