Nestify provides a Rust macro for streamlined nested struct definitions, enhancing code readability. It's especially valuable for handling API responses.
Add this to your Cargo.toml
:
toml
[dependencies]
nestify = "0.1.1"
Then, in your Rust code, import the crate and macro:
rust
extern crate nestify;
use nestify::nestify;
Here's a basic example:
```rust use nestify::nestify;
nestify!{ struct MyOuterStruct { field1: struct MyInnerStruct { subfield1: i32, subfield2: String, }, field2: f64, } } ```
This will produce:
```rust struct MyInnerStruct { subfield1: i32, subfield2: String, }
struct MyOuterStruct { field1: MyInnerStruct, field2: f64, } ```
This project is being activley worked on
This project is licensed under the MIT License