3 type Validator<'a> = dyn 'a + Send + Sync + Fn(&'a Something) -> Result<(), ()>;
5 pub static ALL_VALIDATORS: &[(&'static str, &'static Validator)] =
6 &[("validate that credits and debits balance", &validate_something)];
8 fn or<'a>(first: &'static Validator<'a>, second: &'static Validator<'a>) -> Validator<'a> {
9 //~^ ERROR return type cannot have an unboxed trait object
10 return Box::new(move |something: &'_ Something| -> Result<(), ()> {
11 first(something).or_else(|_| second(something))
15 fn validate_something(_: &Something) -> Result<(), ()> {