summaryrefslogtreecommitdiff
path: root/macros/src/capability.rs
blob: 7dd4c42a2824426e5a32c39b866d306b2ec14daf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
use super::*;

/// Expand the `#[capability]` macro.
pub fn expand(body: syn::ItemTrait) -> Result<TokenStream> {
    let ident = &body.ident;
    Ok(quote! {
        #body
        impl ::typst::model::Capability for dyn #ident {}
    })
}