flamer
flamer copied to clipboard
RFE: Marking all pub API of modules/structs at once
It would be great to have a way of marking all pub fn
of modules, structs, ... marked for flaming using one single command.
Currently, I add
#[cfg_attr(feature="flame_it", flame)]
to all pub fn
of major modules and structs manually.
To some degree (i.e. sans visibility constraint) could easily do this with apply_attr like this:
#![cfg_attr(feature = "flame_it", apply_attr(to(fns, impls(fns)), as_default(flame)))]
… will apply #[flame]
to every directly contained fn
or impl fn
in the current scope.
</shameless plug>
So you'd like a #[flame(pub)]
annotation that only instruments public items?
First, I didn't realize that I can do #![flame]
and get the whole module flamed. That's awesome!
Now, after using that, I can see that being able to limit it to only pub fn
s would make it more usable. So, yes, something like [flame(pub)]
would be great!
Also, another thing I noticed is that #![flame]
applies it to any use
d fn, as well. Any chance that can also be optional, so we can only apply it to thing belonging to the module itself?
Huh? That one is new. I think it may have to do with some recent changes in the AST logic.