tpl-type-length-value-derive 3.2.2

Derive Macro Library for TPL Type Length Value traits
Documentation
//! Crate defining a derive macro for a basic `borsh` implementation of
//! the trait `VariableLenPack`.

#![deny(missing_docs)]
#![cfg_attr(not(test), forbid(unsafe_code))]

extern crate proc_macro;

mod builder;

use {
    builder::TplBorshVariableLenPackBuilder, proc_macro::TokenStream, quote::ToTokens,
    syn::parse_macro_input,
};

/// Derive macro to add `VariableLenPack` trait for borsh-implemented types
#[proc_macro_derive(TplBorshVariableLenPack)]
pub fn tpl_borsh_variable_len_pack(input: TokenStream) -> TokenStream {
    parse_macro_input!(input as TplBorshVariableLenPackBuilder)
        .to_token_stream()
        .into()
}