use proc_macro::TokenStream; use quote::quote; use syn::{Data, DeriveInput, Fields, parse_macro_input}; /// Derive macro for generating a `validate` method for a Theme struct. /// The `validate` method ensures that all values with the `validate` attribute are not `None`. /// Otherwise, an error message it output to both the log file and stdout and the program exits. /// /// # Example /// /// Valid themes pass through the program transitively without any messages being output. /// /// ``` /// use validate_theme_derive::ValidateTheme; /// /// #[derive(ValidateTheme, Default)] /// struct Theme { /// pub name: String, /// #[validate] /// pub good: Option