match-by-hash 1.0.1

Match statement, but for any value and with a hash function
Documentation
use input::Input;
use proc_macro::TokenStream as TokenStream1;

mod input;
mod output;

/// # Example
/// ```rust
/// use match_by_hash::match_by_hash;
///
/// const fn hash(s: &str) -> usize { s.len() }
///
/// let result = match_by_hash!(match hash("target") {
///     "other" => 9,
///     "target" => 42,
///     _ => 999,
/// });
/// assert_eq!(result, 42);
/// ```
#[proc_macro]
pub fn match_by_hash(input: TokenStream1) -> TokenStream1 {
    let input = syn::parse_macro_input!(input as Input);
    output::into_stream(&input).into()
}