bevy/crates/bevy_state/macros/src/lib.rs
theotherphil 476d79d821
deny(missing_docs) for bevy_state (#19492)
# Objective

Deny missing docs in bevy_state, towards
https://github.com/bevyengine/bevy/issues/3492.
2025-06-04 20:43:47 +00:00

29 lines
797 B
Rust

#![cfg_attr(docsrs, feature(doc_auto_cfg))]
//! Macros for deriving `States` and `SubStates` traits.
extern crate proc_macro;
mod states;
use bevy_macro_utils::BevyManifest;
use proc_macro::TokenStream;
/// Implements the `States` trait for a type - see the trait
/// docs for an example usage.
#[proc_macro_derive(States, attributes(states))]
pub fn derive_states(input: TokenStream) -> TokenStream {
states::derive_states(input)
}
/// Implements the `SubStates` trait for a type - see the trait
/// docs for an example usage.
#[proc_macro_derive(SubStates, attributes(states, source))]
pub fn derive_substates(input: TokenStream) -> TokenStream {
states::derive_substates(input)
}
pub(crate) fn bevy_state_path() -> syn::Path {
BevyManifest::shared().get_path("bevy_state")
}