File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -98,10 +98,12 @@ fn is_array_of_array(ty: &Type) -> bool {
9898 unwrap_array_type ( ty) . is_some_and ( is_array)
9999}
100100
101+ type TypeCheck = ( fn ( & Type ) -> bool , & ' static str ) ;
102+
101103/// Validate that a type does not use unsupported nesting patterns.
102104/// Returns `Some(compile_error!(...))` if the type is invalid, `None` if valid.
103105fn validate_field_type ( ty : & Type ) -> Option < TokenStream > {
104- let checks: & [ ( fn ( & Type ) -> bool , & str ) ] = & [
106+ let checks: & [ TypeCheck ] = & [
105107 ( is_vec_of_option, "Vec<Option<T>> is not supported. Protobuf repeated fields cannot represent null/missing elements." ) ,
106108 ( is_option_of_vec, "Option<Vec<T>> is not supported. Protobuf cannot distinguish between absent and empty repeated fields." ) ,
107109 ( is_vec_of_vec, "Vec<Vec<T>> is not supported. Protobuf does not support nested repeated fields." ) ,
You can’t perform that action at this time.
0 commit comments