Skip to content

Commit 6d22e98

Browse files
committed
clippy
1 parent 32c1266 commit 6d22e98

File tree

1 file changed

+3
-1
lines changed
  • rust/foxglove_derive/src

1 file changed

+3
-1
lines changed

rust/foxglove_derive/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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.
103105
fn 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."),

0 commit comments

Comments
 (0)