Skip to content

Commit

Permalink
update CONTRIBUTING.md section about syn
Browse files Browse the repository at this point in the history
  • Loading branch information
pvdrz authored and qsdrqs committed Oct 26, 2022
1 parent eaec6e0 commit 9b14b89
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,14 +323,12 @@ generated Rust code are implemented using the [`syn`](https://docs.rs/syn) crate

### Implementing new options using `syn`

Here is a list of recommendations to be followed if a new option can be
implemented using the `syn` crate:
If a new option can be implemented using the `syn` crate it should be added to
the `codegen::postprocessing` module by following these steps:

- The `BindgenOptions::require_syn` method must be updated to reflect that this
new option requires parsing the generated Rust code with `syn`.

- The implementation of the new option should be added at the end of
`Bindings::generate`, inside the `if options.require_syn() { ... }` block.
- Introduce a new `struct` with no fields.
- Implement the `PostProcessing` trait for the `struct`.
- Add the `struct` to the `decl_postprocessing` macro invocation.

## Pull Requests and Code Reviews

Expand Down

0 comments on commit 9b14b89

Please sign in to comment.