Skip to content

Commit f29a63c

Browse files
durin42krasimirgg
andauthored
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>
1 parent 82462c8 commit f29a63c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

extensions/bindgen/private/bindgen.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ def _rust_bindgen_impl(ctx):
241241
args.add_all(ctx.attr.bindgen_flags)
242242

243243
rust_toolchain = ctx.toolchains[Label("@rules_rust//rust:toolchain_type")]
244-
if "--rust-edition " not in [f.split("=")[0] for f in ctx.attr.bindgen_flags]:
244+
if "--rust-edition" not in [f.split("=")[0] for f in ctx.attr.bindgen_flags]:
245245
args.add("--rust-edition=%s" % rust_toolchain.default_edition)
246246

247247
args.add(header)

0 commit comments

Comments
 (0)