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

refactor!: remove unnecessary declarative macros #132

Merged
merged 3 commits into from
Feb 14, 2025

Conversation

bavshin-f5
Copy link
Member

Remove a few overly direct translations of C macros to Rust declarative macros.

ngx_string! will be addressed separately, as the replacement has to ensure that the byte slice constants are NULL-terminated, and I haven't figured out the best way to enforce that (fn from_static(src: &'static CStr) -> ngx_str_t is the leading contender).

Copy link
Contributor

@xeioex xeioex left a comment

Choose a reason for hiding this comment

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

There are no nginx core APIs that take a list of variables, terminated
by an empty entry. The variables are always added from the module code,
where we should use Rust iterators.
  1. We do not need the comma in the first sentence.
  2. The variables -> Variables (not specific variables).
There are no nginx core APIs that take a list of variables terminated
by an empty entry. Variables are always added from the module code,
where we should use Rust iterators.

There are no nginx core APIs that take a list of variables terminated
by an empty entry. Variables are always added from the module code,
where we should use Rust iterators.
Copy link
Contributor

@xeioex xeioex left a comment

Choose a reason for hiding this comment

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

Otherwise looks good.

@bavshin-f5 bavshin-f5 merged commit 7b96bc9 into nginx:master Feb 14, 2025
10 checks passed
@bavshin-f5 bavshin-f5 deleted the less-macros branch February 14, 2025 02:33
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