diff options
author | Christian Poveda <christian.poveda@ferrous-systems.com> | 2022-09-23 15:24:19 -0500 |
---|---|---|
committer | Christian Poveda <christian.poveda@ferrous-systems.com> | 2022-09-23 15:24:19 -0500 |
commit | 0e4c1ae92c8ab89bf2285cf3b4540821fb480850 (patch) | |
tree | bfa1d3f4016bee9fa03e249974f2b639f0dc36c1 | |
parent | e1f314eb44b09268c6d05ff152f3ddd61e635135 (diff) |
update `CONTRIBUTING.md` section about `syn`
-rw-r--r-- | CONTRIBUTING.md | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2974ba42..3d757ccd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 |