blob: dff63757cff0a5889f86d87e710e5ec5feb1e725 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#![feature(attr_literals)]
#[macro_use] extern crate validator_derive;
extern crate validator;
use validator::{Validate, ValidationError};
#[derive(Validate)]
struct Test {
#[validate(custom = "validate_something")]
s: String,
}
#[derive(Validate)]
struct TestPath {
#[validate(custom = "::validate_something")]
s: String,
}
fn validate_something(s: &str) -> Result<(), ValidationError> {
Ok(())
}
fn main() {}
|