nestify 0.3.3

Nestify offers a macro to simplify and beautify nested struct definitions in Rust, enabling cleaner, more readable code structures with less verbosity. It's especially valuable for handling API responses.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use proc_macro2::TokenStream;
use quote::ToTokens;
use syn::{Expr, Token};

pub struct Discriminant {
    pub eq_token: Token![=],
    pub expr: Expr,
}

impl ToTokens for Discriminant {
    fn to_tokens(&self, tokens: &mut TokenStream) {
        self.eq_token.to_tokens(tokens);
        self.expr.to_tokens(tokens);
    }
}