Skip to main content

soavec_derive/
lib.rs

1// This Source Code Form is subject to the terms of the Mozilla Public
2// License, v. 2.0. If a copy of the MPL was not distributed with this
3// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4
5mod soable;
6
7use proc_macro::TokenStream;
8use syn::{DeriveInput, parse_macro_input};
9
10#[proc_macro_derive(SoAble)]
11pub fn derive_soable(input: TokenStream) -> TokenStream {
12    let input = parse_macro_input!(input as DeriveInput);
13    soable::expand_derive_soable(input)
14        .unwrap_or_else(syn::Error::into_compile_error)
15        .into()
16}