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

Make pom dependency optional (but default) #112

Merged
merged 1 commit into from
Aug 11, 2020
Merged

Conversation

z33ky
Copy link
Contributor

@z33ky z33ky commented Aug 4, 2020

A downside is that the add_barcode example is not compiled for the nom_parser feature. I don't know how to express that, or if it is even possible. It seems like a very minor drawback though.

@J-F-Liu
Copy link
Owner

J-F-Liu commented Aug 10, 2020

Is there a way to reduce the number of #[cfg] attributes?

@z33ky
Copy link
Contributor Author

z33ky commented Aug 10, 2020

I could move the "auxiliary parsing" methods to a parser module (likewise for the tests), so only the #[cfg]s in lib.rs are required to enable them.
Alternatively a no-op dummy parser could be created, but I think that's a worse idea. I'll try my first suggestion.

@z33ky
Copy link
Contributor Author

z33ky commented Aug 10, 2020

From 25 down to 75 added #[cfg]s. I skipped splitting up the tests, since that would require an required_features-entry in the Cargo.toml, which would then, like the add_barcode example only be available for pom_parser, but not nom_parser.

@J-F-Liu J-F-Liu merged commit bcb4bf5 into J-F-Liu:master Aug 11, 2020
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