rust-lang / rust-lang/rust-bindgen
strip common prefix on enum variant name
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 5.3k
- Forks
- 829
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 15
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
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.
Assessment
- Tech stack
- rust
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100