bindgen: remove extra trailing space in check for --rust-edition flags (#3799)
The arguments would be passed as either `--rust-edition=2024` or
`--rust-edition`, `2024`, but either way the resulting entry from the
list comprehension on the right hand of the `not in` operator will
contain `"--rust-edition"` without the trailing space. This allows users
of the bindgen rules to specify their own explicit edition.
Tested:
Works in our private repo, and didn't without this patch.
Co-authored-by: Krasimir Georgiev <krasimir@google.com>
diff --git a/extensions/bindgen/private/bindgen.bzl b/extensions/bindgen/private/bindgen.bzl
index 426cdd4..41c37af 100644
--- a/extensions/bindgen/private/bindgen.bzl
+++ b/extensions/bindgen/private/bindgen.bzl
@@ -241,7 +241,7 @@
args.add_all(ctx.attr.bindgen_flags)
rust_toolchain = ctx.toolchains[Label("@rules_rust//rust:toolchain_type")]
- if "--rust-edition " not in [f.split("=")[0] for f in ctx.attr.bindgen_flags]:
+ if "--rust-edition" not in [f.split("=")[0] for f in ctx.attr.bindgen_flags]:
args.add("--rust-edition=%s" % rust_toolchain.default_edition)
args.add(header)