Skip to content

Commit

Permalink
fix: error message.
Browse files Browse the repository at this point in the history
  • Loading branch information
yassun7010 committed Jun 20, 2024
1 parent fac6f9e commit a16b444
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion serde_valid_derive/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use crate::attribute::{
MetaNameValueCustomMessage, MetaNameValueFieldValidation, MetaNameValueStructValidation,
MetaPathCustomMessage, MetaPathFieldValidation, MetaPathStructValidation,
};
use itertools::Itertools;
use proc_macro2::TokenStream;
use quote::{quote, ToTokens};
use syn::spanned::Spanned;
Expand Down Expand Up @@ -303,6 +304,7 @@ impl Error {
let candidates = &(MetaPathFieldValidation::iter().map(|x| x.name()))
.chain(MetaListFieldValidation::iter().map(|x| x.name()))
.chain(MetaNameValueFieldValidation::iter().map(|x| x.name()))
.unique()
.collect::<Vec<_>>();

let filterd_candidates =
Expand Down Expand Up @@ -370,7 +372,7 @@ impl Error {
pub fn validate_enumerate_need_array(path: impl Spanned) -> Self {
Self::new(
path.span(),
"#[validate(enumerate = ???)] needs array literals.",
"#[validate(enumerate = ???)] needs literal array only.",
)
}

Expand Down

0 comments on commit a16b444

Please sign in to comment.