mirror of
https://gitee.com/openharmony/third_party_rust_bindgen
synced 2025-03-02 11:47:44 +00:00
update CONTRIBUTING.md
section about syn
This commit is contained in:
parent
a372499b93
commit
3dfbc602ae
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user