validator_struct 0.3.1

A simple ergonomic addition to the validator crate
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use quote::ToTokens;

mod metadata;
pub mod type_props;

pub fn occurrence_error<T: ToTokens>(fst: T, snd: T, attr: &str) -> syn::Error {
    let mut e = syn::Error::new_spanned(
        snd,
        format!("Found multiple occurrences of strum({})", attr),
    );
    e.combine(syn::Error::new_spanned(fst, "first one here"));
    e
}