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

Cleaner macros utilizing syn::Member #18199

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

Bleachfuel
Copy link
Contributor

Objective

Some macros were handling Idents and indexes as seperate things, we can use syn::Member to make this more readable and nicer.

Testing

ran all revelant crate tests.

@Bleachfuel
Copy link
Contributor Author

Bleachfuel commented Mar 8, 2025

#[derive(QueryData)]
#[query_data(mutable(foo))]
//~^ ERROR: `mutable` does not take any arguments
struct MutableInvalidAttributeParameters {
    a: &'static mut Foo,
}

should we really give a error for this? seems so unnessesary and extra code. When u do this it already says "expected ,". I removed 2 of them, since the errors that syn gives are already clear. Maybe even clearer.

@alice-i-cecile alice-i-cecile added C-Code-Quality A section of code that is hard to understand or change X-Uncontroversial This work is generally agreed upon D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward D-Macros Code that generates Rust code labels Mar 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Code-Quality A section of code that is hard to understand or change D-Macros Code that generates Rust code D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward X-Uncontroversial This work is generally agreed upon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants