diff options
| author | Bastien Orivel | 2018-03-18 23:38:38 +0100 |
|---|---|---|
| committer | Bastien Orivel | 2018-03-18 23:38:38 +0100 |
| commit | 8ca1fe94d779dcccf4b3f4c23a08f3ede7e10956 (patch) | |
| tree | 3613384d280a666e096ba880e667b638083beba4 /validator_derive/tests | |
| parent | 6ce2d3a5264fb337d9a8b5f365fc98387baafa8a (diff) | |
| download | validator-8ca1fe94d779dcccf4b3f4c23a08f3ede7e10956.tar.bz2 | |
Fix path parsing for custom validators
`::foo::bar` isn't a valid ident in syn 0.12. This lead to some code
failing to compile if it was using paths as custom validators.
This fixes it and adds a test.
Diffstat (limited to 'validator_derive/tests')
| -rw-r--r-- | validator_derive/tests/run-pass/custom.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/validator_derive/tests/run-pass/custom.rs b/validator_derive/tests/run-pass/custom.rs index 3a2a396..dff6375 100644 --- a/validator_derive/tests/run-pass/custom.rs +++ b/validator_derive/tests/run-pass/custom.rs @@ -10,6 +10,12 @@ struct Test { s: String, } +#[derive(Validate)] +struct TestPath { + #[validate(custom = "::validate_something")] + s: String, +} + fn validate_something(s: &str) -> Result<(), ValidationError> { Ok(()) } |
