Skip to content

Simplify windows-bindgen internals: Step C smaller leftovers - #4451

Merged
Kenny Kerr (kennykerr) merged 1 commit into
masterfrom
copilot/review-fmt-clippy
May 20, 2026
Merged

Simplify windows-bindgen internals: Step C smaller leftovers#4451
Kenny Kerr (kennykerr) merged 1 commit into
masterfrom
copilot/review-fmt-clippy

Conversation

Copilot AI commented May 20, 2026

Copy link
Copy Markdown
Contributor

Continues #4450 by picking off Step C ("smaller leftovers") from docs/bindgen.md.

  • Sentinel-string fields → Option. Bindgen::rustfmt and Bindgen::link are now Option<String> (and Config::rustfmt is Option<&str>), replacing the """ means default" sentinel with a plain Option match in Bindgen::write and format.rs.
  • Singular builders delegate to plural. input/filter/derive/reference are one-line self.<plural>(std::iter::once(x)) wrappers; the plural forms remain the single source of truth.
  • prepend_default_refs rewritten.Vec::insert(0, …) → one splice(0..0, paths.iter().rev().map(…)). Single O(n) shift; .rev() reproduces the historical ordering that repeated insert(0, …) produced.
  • --etc documented. Added to the supported-arguments table in crates/libs/bindgen/src/lib.rs; the response-file feature used by crates/tools/bindings is no longer undocumented.
  • docs/bindgen.md trimmed. Section C removed and dropped from the suggested order of attack, leaving Steps A (merge Bindgen/Config) and B (split config/) as the remaining work.

No public API or behaviour changes.

@kennykerr
Kenny Kerr (kennykerr) marked this pull request as ready for review May 20, 2026 20:18
@kennykerr
Kenny Kerr (kennykerr) merged commit 1050e18 into master May 20, 2026
29 checks passed
@kennykerr
Kenny Kerr (kennykerr) deleted the copilot/review-fmt-clippy branch May 20, 2026 20:18
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