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

derive: some clean-ups and optimizations #260

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Kijewski
Copy link
Collaborator

Minor changes extracted from the enum implementation. Please see the individual commits.

@Kijewski Kijewski marked this pull request as ready for review November 20, 2024 21:03
Some((ident, PartialTemplateArgsSource::InDoc(_))) => {
source_from_docs(&ident, &args.meta_docs, ast)?
Some(PartialTemplateArgsSource::InDoc(s)) => {
source_from_docs(s.span(), &args.meta_docs, ast)?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find!

@@ -7,10 +7,10 @@ error: unknown node `fail`
| ^^^^^^^^^^^^^^^^^^^^^^

error: when using `in_doc = true`, the struct's documentation needs a `rinja` code block
--> tests/ui/rinja-block.rs:15:25
--> tests/ui/rinja-block.rs:15:34
|
15 | #[template(ext = "txt", in_doc = true)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it underline the whole in_doc = true?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the other cases we also only underline the value part, the part after the equals sign. I actually came to like that, because the problem is with the value, not with the key. If you write in_doc = false, then everything is fine (except that in here there is not source).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmmmmmm. Then the message needs to be reworded a bit to make it obvious that the value is the value. Like:

when using in_doc with the true value, the struct's documentation needs a rinja code block

Or something like that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the message a bit. Do you think it's more clear now?

GuillaumeGomez
GuillaumeGomez previously approved these changes Nov 20, 2024
@GuillaumeGomez
Copy link
Contributor

Apart from my one comment, looks all good to me, thanks! Please feel free to merge even without fixing my comment (but if you do, please open an issue so we don't forget about it and I'd love to fix it 😄 ).

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