Skip to main content

apply

Attribute Macro apply 

Source
#[apply]
Expand description

Apply the given macro to the annotated item, appending additional tokens if provided.

ยงExample

use macro_rules_attr::apply;

macro_rules! rename_to_unit {
    ($vis:vis struct $Name:ident;) => {
        $vis struct Unit;
    };
}

#[apply(rename_to_unit)]
struct Original;

let _ = Unit;