blob: 3a2a396db805bdb33caab44072d54188e3e493a1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#![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,
}
fn validate_something(s: &str) -> Result<(), ValidationError> {
Ok(())
}
fn main() {}
|