Skip to content
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

Merged
merged 6 commits into from
Oct 3, 2018
Merged

Conversation

antonok-edm
Copy link
Contributor

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.

Copy link
Owner

@llogiq llogiq left a 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.


pub struct Lower {

}
Copy link
Owner

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) => {
Copy link
Owner

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?

@antonok-edm
Copy link
Contributor Author

antonok-edm commented Oct 3, 2018

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.

@llogiq llogiq merged commit 34fdfb8 into llogiq:master Oct 3, 2018
@llogiq
Copy link
Owner

llogiq commented Oct 3, 2018

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants