-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fd3e0b2
commit bd49d9b
Showing
12 changed files
with
64 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,6 +88,7 @@ enum_str! { | |
|
||
enum_str! { | ||
pub enum MetaNameValueStructValidation { | ||
Custom = "custom", | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
mod generic; | ||
pub mod generic; | ||
mod meta; | ||
|
||
use crate::{attribute::Validator, warning::WithWarnings}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
mod custom; | ||
|
||
pub use custom::extract_generic_struct_custom_validator; | ||
pub use custom::{ | ||
extract_generic_struct_custom_validator_from_meta_list, | ||
extract_generic_struct_custom_validator_from_meta_name_value, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 10 additions & 4 deletions
14
serde_valid_derive/src/attribute/struct_validate/meta/meta_name_value.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
use crate::attribute::{ | ||
common::message_format::MessageFormat, MetaNameValueStructValidation, Validator, | ||
common::message_format::MessageFormat, | ||
struct_validate::generic::extract_generic_struct_custom_validator_from_meta_name_value, | ||
MetaNameValueStructValidation, Validator, | ||
}; | ||
|
||
#[inline] | ||
pub fn extract_struct_validator_from_meta_name_value( | ||
validation_type: MetaNameValueStructValidation, | ||
_validation: &syn::MetaNameValue, | ||
_message_format: MessageFormat, | ||
validation: &syn::MetaNameValue, | ||
message_format: MessageFormat, | ||
) -> Result<Validator, crate::Errors> { | ||
match validation_type {} | ||
match validation_type { | ||
MetaNameValueStructValidation::Custom => { | ||
extract_generic_struct_custom_validator_from_meta_name_value(validation, message_format) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
mod generic; | ||
mod meta; | ||
|
||
use crate::attribute::Validator; | ||
|
This file was deleted.
Oops, something went wrong.
82 changes: 0 additions & 82 deletions
82
serde_valid_derive/src/attribute/variant_validate/generic/custom.rs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 10 additions & 4 deletions
14
serde_valid_derive/src/attribute/variant_validate/meta/meta_name_value.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
use crate::attribute::{ | ||
common::message_format::MessageFormat, MetaNameValueStructValidation, Validator, | ||
common::message_format::MessageFormat, | ||
struct_validate::generic::extract_generic_struct_custom_validator_from_meta_name_value, | ||
MetaNameValueStructValidation, Validator, | ||
}; | ||
|
||
#[inline] | ||
pub fn extract_variant_validator_from_meta_name_value( | ||
validation_type: MetaNameValueStructValidation, | ||
_validation: &syn::MetaNameValue, | ||
_message_format: MessageFormat, | ||
validation: &syn::MetaNameValue, | ||
message_format: MessageFormat, | ||
) -> Result<Validator, crate::Errors> { | ||
match validation_type {} | ||
match validation_type { | ||
MetaNameValueStructValidation::Custom => { | ||
extract_generic_struct_custom_validator_from_meta_name_value(validation, message_format) | ||
} | ||
} | ||
} |