matched_enums 1.3.0

A macro that provides the option to bin enum attribute to match-statements. This makes it easier to convert values into enums.
Documentation
#![doc = include_str!("../README.md")]
#![no_std]

pub use matched_enums_macro::*;
pub use matched_enums_types::*;

extern crate alloc;

#[cfg(feature = "runtime_configurable")]
mod runtime_configurable_extras {
    use alloc::boxed::Box;

    /// Helper macro to indicate the runtime match should pass when a value matches the given pattern.
    #[macro_export]
    macro_rules! match_when {
        ( $pattern: pat ) => {
            alloc::boxed::Box::new(move |&value| matches!(value, $pattern))
        };
    }

    /// Helper function to indicate the runtime match should never pass.
    pub fn match_never<T>() -> Box<dyn Fn(&T) -> bool> {
        Box::new(|_| false)
    }
}

#[cfg(feature = "runtime_configurable")]
pub use runtime_configurable_extras::*;

#[cfg(test)]
mod tests;