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

Add a Builder::headers helper #2738

Closed
kupiakos opened this issue Jan 27, 2024 · 4 comments
Closed

Add a Builder::headers helper #2738

kupiakos opened this issue Jan 27, 2024 · 4 comments

Comments

@kupiakos
Copy link

kupiakos commented Jan 27, 2024

Much like clang_args, a helper for adding multiple headers in a chained builder expression. The signature should be:

pub fn headers<I: IntoIterator>(self, headers: I) -> Self where I::Item: Into<String>
christianheussy added a commit to christianheussy/rust-bindgen that referenced this issue Feb 2, 2024
Problem: It's cumbersome to define multiple input headers using the
existing `header` API. It's difficult for the user to configure the
`Builder` with a list of input headers.

Solution: Add `headers` method that permits adding multiple headers via
an iterable of Strings.

Testing: Added `test_headers_call_in_builder`. Ran `cargo test` in
`bindgen-tests/tests/expectations`.

Issue: rust-lang#2738
@christianheussy
Copy link
Contributor

I'm learning Rust and took a crack at this!

christianheussy added a commit to christianheussy/rust-bindgen that referenced this issue Feb 5, 2024
Problem: It's cumbersome to define multiple input headers using the
existing `header` API. It's difficult for the user to configure the
`Builder` with a list of input headers.

Solution: Add `headers` method that permits adding multiple headers via
an iterable of Strings.

Testing: Added `test_headers_call_in_builder`. Ran `cargo test` in
`bindgen-tests/tests/expectations`.

Issue: rust-lang#2738
emilio pushed a commit that referenced this issue Feb 7, 2024
Problem: It's cumbersome to define multiple input headers using the
existing `header` API. It's difficult for the user to configure the
`Builder` with a list of input headers.

Solution: Add `headers` method that permits adding multiple headers via
an iterable of Strings.

Testing: Added `test_headers_call_in_builder`. Ran `cargo test` in
`bindgen-tests/tests/expectations`.

Issue: #2738
@tshepang
Copy link
Member

should this be closed

@pvdrz
Copy link
Contributor

pvdrz commented Mar 26, 2024

I think so, there's a commit on main with the change. @christianheussy feel free to reopen this if your changes didn't made it to main for some reason.

@pvdrz pvdrz closed this as completed Mar 26, 2024
@christianheussy
Copy link
Contributor

They did, thanks for closing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants