-
Notifications
You must be signed in to change notification settings - Fork 14
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
generator: better macro hygiene #192
Merged
Merged
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f9e96da
generator: use `rinja` instead of `CRATE`
Kijewski b18bf04
generator: remove superfluous `format_args!()` invocations
Kijewski d557f30
generator: harmonize use of `X<Y: Z>` vs `X<Y> where Y: Z`
Kijewski bba4e26
generator: add missing fully-qualified name
Kijewski dfcfde9
generator: use re-exported `core` and `std`
Kijewski bdd6866
generator: move re-exported `{core,std}` into `rinja::helpers`
Kijewski 4d7a64f
rinja: move `#[doc(hidden)]` to the module declaration
Kijewski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
You can refer to
core
andstd
by prepending them with::
in macros. Like::core::whatever
. If not, then add a comment to explain why we want it. Also, it's really not great because it's not rare for users to douse rinja::*;
.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.
The current code already does that, but even fully-qualified paths like
::core
and::std
can be shadowed. See the example intesting
.But yeah, I didn't recognize the problem that
use rinja::*
would import the symbolcore
, too, which might be undesirable. Python is smarter than rust in a way: Symbols with a leading underscore are omitted from glob imports. Would be nice if rust did that, too.I guess I'll simply move the re-exports into the existing
#[doc(hidden)] mod helpers
. The name already exists, so it can't introduce a new problem.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.
A new module containing it would be better indeed. 👍