strip common prefix on enum variant name

Open
#3,357 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
rust
Domain
cli, tooling

Research direction

Start by tracing the CLI tool's enum-related options and comparing them with the ParseCallbacks::enum_variant_name entry point mentioned in the issue. Check how enum variants are processed across a complete enum, then define done as a CLI-supported way to strip a shared prefix without requiring manually listed callbacks, verified against representative generated bindings.

Written by the indexing model from the issue text.

Description

Hi,

I'm using the CLI tool to avoid wasting CI minutes on recompiling bindgen, so I'm looking for a CLI solution.

I've read about the ParseCallbacks::enum_variant_name solution, but I'm not sure how to use it. For starters it seems to not be available in the CLI tool, but furthermore I need all enum variants in the same callback to be able to find the prefix, right?

I'm generating bindings for a C library that has hundreds of enums, so manually listing them isn't a great solution.

Regards

Dominant language
Rust
Stars
5.3k
Forks
846
Avg merge
2d 6h
Merged PRs (30d)
11

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rust-lang/rust-bindgen

All issues in rust-lang/rust-bindgen

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.