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

Simplify boilerplate in the Rhai plugin #1414

Merged
merged 3 commits into from
Jul 20, 2022
Merged

Simplify boilerplate in the Rhai plugin #1414

merged 3 commits into from
Jul 20, 2022

Conversation

SimonSapin
Copy link
Contributor

@SimonSapin SimonSapin commented Jul 19, 2022

See individual commit messages.

Only the last commit should affect behavior (and has a corresponding changelog entry).

@github-actions

This comment has been minimized.

The crate allows macros to concatenate (possibly variable) identifiers into
a single identifier. We can avoid that by using `::` to build up paths instead,
and make a module hierarchy that reexports items with desired names.

Also replace some single-use functions with closures.
This avoids concatenating a name for them.
Instead, inline generic users (which had become one-liners)
into their own non-generic (macro-based) users.
@@ -190,7 +190,7 @@ where
}
.or_else(|error: BoxError| async move {
let errors = vec![crate::error::Error {
message: error.to_string(),
message: dbg!(error.to_string()),
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like this is left in by mistake, but...?

@SimonSapin SimonSapin merged commit 6a1f01a into main Jul 20, 2022
@SimonSapin SimonSapin deleted the simon/unmacro branch July 20, 2022 14:07
SimonSapin added a commit that referenced this pull request Jul 20, 2022
SimonSapin added a commit that referenced this pull request Jul 20, 2022
@garypen garypen added this to the v0.14.0 milestone Aug 2, 2022
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.

None yet

2 participants