-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add optional prefix for annotations #33
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good; I have only two very minor nits. Please change them or tell me you won't; I'm happy to merge as is, too.
tests/opt_name.rs
Outdated
|
||
pub struct Lower { | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason not to write this as pub struct Lower;
?
src/lib.rs
Outdated
a: Annotatable) -> Annotatable { | ||
let opt_ident = match mi.node { | ||
MetaItemKind::Word => None, | ||
MetaItemKind::List(ref v) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be simplified to match against MetaItemKind::List(ref v) if v.len() == 1 => { .. }
and _ => None
?
Thanks, I didn't know about those tricks back when I wrote this :) I also fixed the merge conflict that arose from removing quote_block. Should be all set now. |
Thank you! |
There were a few people interested in issue #16. I just stumbled upon this crate -- I love the idea behind it, but I also need that feature to use it in my own work since I have a few different structs with methods of the same name.
I think having automatic full path names would be even nicer than this solution, but I'm not that well versed with writing language extensions just yet. In the meantime, this works well enough for my (and hopefully others') needs.