diff --git a/serde_valid_derive/src/attribute/field_validate/generic/enumerate.rs b/serde_valid_derive/src/attribute/field_validate/generic/enumerate.rs index 27ddbc9..e07054d 100644 --- a/serde_valid_derive/src/attribute/field_validate/generic/enumerate.rs +++ b/serde_valid_derive/src/attribute/field_validate/generic/enumerate.rs @@ -63,7 +63,7 @@ fn get_enumerate(meta_list: &syn::MetaList) -> Result { crate::types::NestedMeta::Lit(lit) => enumerate.push(lit.clone()), crate::types::NestedMeta::Meta(meta) => errors.push(crate::Error::literal_only(meta)), crate::types::NestedMeta::Closure(closure) => { - errors.push(crate::Error::closure_not_support(closure)) + errors.push(crate::Error::closure_not_supported(closure)) } } } diff --git a/serde_valid_derive/src/attribute/field_validate/meta.rs b/serde_valid_derive/src/attribute/field_validate/meta.rs index 8725577..fdd31a0 100644 --- a/serde_valid_derive/src/attribute/field_validate/meta.rs +++ b/serde_valid_derive/src/attribute/field_validate/meta.rs @@ -27,7 +27,7 @@ pub fn extract_field_validator( syn::Meta::List(list) => inner_extract_field_validator(field, attribute, list, rename_map), syn::Meta::Path(_) => extract_generic_validate_validator(field, rename_map), syn::Meta::NameValue(name_value) => { - Err(vec![crate::Error::validate_meta_name_value_not_support( + Err(vec![crate::Error::validate_meta_name_value_not_supported( name_value, )]) } @@ -57,9 +57,9 @@ fn inner_extract_field_validator( 2 => match extract_custom_message_format(&nested[1]) { Ok(custom_message) => { if nested[0].path().is_ident("custom") { - errors.push(crate::Error::validate_custom_not_support_custom_message( - &nested[1], - )); + errors.push( + crate::Error::validate_custom_does_not_support_custom_message(&nested[1]), + ); None } else { Some(custom_message) diff --git a/serde_valid_derive/src/attribute/struct_validate/meta.rs b/serde_valid_derive/src/attribute/struct_validate/meta.rs index cf0b396..f5f049a 100644 --- a/serde_valid_derive/src/attribute/struct_validate/meta.rs +++ b/serde_valid_derive/src/attribute/struct_validate/meta.rs @@ -24,7 +24,7 @@ pub fn extract_struct_validator(attribute: &syn::Attribute) -> Result Ok(quote!()), syn::Meta::List(list) => inner_extract_struct_validator(attribute, list), syn::Meta::NameValue(name_value) => { - Err(vec![crate::Error::validate_meta_name_value_not_support( + Err(vec![crate::Error::validate_meta_name_value_not_supported( name_value, )]) } @@ -52,9 +52,9 @@ fn inner_extract_struct_validator( 2 => match extract_custom_message_format(&nested[1]) { Ok(custom_message) => { if nested[0].path().is_ident("custom") { - errors.push(crate::Error::validate_custom_not_support_custom_message( - &nested[1], - )); + errors.push( + crate::Error::validate_custom_does_not_support_custom_message(&nested[1]), + ); None } else { Some(custom_message) diff --git a/serde_valid_derive/src/derive.rs b/serde_valid_derive/src/derive.rs index 39ee645..9067bcc 100644 --- a/serde_valid_derive/src/derive.rs +++ b/serde_valid_derive/src/derive.rs @@ -12,11 +12,11 @@ pub fn expand_derive(input: &syn::DeriveInput) -> Result match fields { syn::Fields::Named(fields) => expand_named_struct_derive(input, fields), syn::Fields::Unnamed(fields) => expand_unnamed_struct_derive(input, fields), - syn::Fields::Unit => Err(vec![crate::Error::unit_struct_not_support(input)]), + syn::Fields::Unit => Err(vec![crate::Error::unit_struct_not_supported(input)]), }, syn::Data::Enum(syn::DataEnum { variants, .. }) => { expand_enum_validate_derive(input, variants) } - syn::Data::Union(_) => Err(vec![crate::Error::union_not_support(input)]), + syn::Data::Union(_) => Err(vec![crate::Error::union_not_supported(input)]), } } diff --git a/serde_valid_derive/src/error.rs b/serde_valid_derive/src/error.rs index bc3dca6..172181f 100644 --- a/serde_valid_derive/src/error.rs +++ b/serde_valid_derive/src/error.rs @@ -162,14 +162,14 @@ impl Error { Error::new(span, message) } - pub fn unit_struct_not_support(input: &syn::DeriveInput) -> Self { + pub fn unit_struct_not_supported(input: &syn::DeriveInput) -> Self { Self::new( input.span(), "#[derive(Validate)] does not support Unit Struct.", ) } - pub fn union_not_support(input: &syn::DeriveInput) -> Self { + pub fn union_not_supported(input: &syn::DeriveInput) -> Self { Self::new(input.span(), "#[derive(Validate)] does not support Union.") } @@ -225,8 +225,8 @@ impl Error { ) } - pub fn validate_meta_name_value_not_support(name_value: &syn::MetaNameValue) -> Self { - Self::new(name_value.span(), "#[validate = ???] does not support.") + pub fn validate_meta_name_value_not_supported(name_value: &syn::MetaNameValue) -> Self { + Self::new(name_value.span(), "#[validate = ???] not supported.") } pub fn meta_path_validation_need_value(path: &syn::Path, validation_type: &str) -> Self { @@ -457,10 +457,10 @@ impl Error { Self::new(lit.span(), "Allow str literal only.") } - pub fn closure_not_support(closure: &syn::ExprClosure) -> Self { + pub fn closure_not_supported(closure: &syn::ExprClosure) -> Self { Self::new( closure.or1_token.span(), - format!("Closure not support. {}", closure.to_token_stream()), + format!("Closure not supported. {}", closure.to_token_stream()), ) } @@ -472,7 +472,7 @@ impl Error { self.0.to_compile_error() } - pub fn validate_custom_not_support_custom_message(meta: &syn::Meta) -> Self { + pub fn validate_custom_does_not_support_custom_message(meta: &syn::Meta) -> Self { Self::new( meta.span(), "#[validate(custon(...), ???)] does not support custom error message.",