From fa79219d2b6ec7d4fe7103704c44b48705c9e9c6 Mon Sep 17 00:00:00 2001 From: Leonid Tyurin Date: Tue, 12 Mar 2024 13:10:54 +0400 Subject: [PATCH] Fix map entry check --- actix-prost-build/src/conversions.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actix-prost-build/src/conversions.rs b/actix-prost-build/src/conversions.rs index 445d679..59bc358 100644 --- a/actix-prost-build/src/conversions.rs +++ b/actix-prost-build/src/conversions.rs @@ -357,7 +357,7 @@ impl ConversionsGenerator { let field_desc = convert_field.map(|cf| &cf.field)?; let map_type = match (field_desc.cardinality(), field_desc.kind()) { - (Cardinality::Repeated, Kind::Message(m)) => Some(m), + (Cardinality::Repeated, Kind::Message(m)) if m.is_map_entry() => Some(m), _ => None, }?; // Map keys can only be of scalar types, so we search for nested messages only in values