From 8ca1fe94d779dcccf4b3f4c23a08f3ede7e10956 Mon Sep 17 00:00:00 2001 From: Bastien Orivel Date: Sun, 18 Mar 2018 23:38:38 +0100 Subject: 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. --- validator_derive/tests/run-pass/custom.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'validator_derive/tests') 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(()) } -- cgit v1.2.3