From dd193ff99d6935ccee52e4c79ced8617b73f7762 Mon Sep 17 00:00:00 2001 From: Nasr Date: Fri, 20 Dec 2024 14:13:05 +0700 Subject: [PATCH 1/2] feat(torii-grpc): add list to member value enum for usasge in sdk --- crates/torii/grpc/src/types/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/torii/grpc/src/types/mod.rs b/crates/torii/grpc/src/types/mod.rs index e9fe1fca42..c20d7483a2 100644 --- a/crates/torii/grpc/src/types/mod.rs +++ b/crates/torii/grpc/src/types/mod.rs @@ -151,6 +151,7 @@ pub enum PatternMatching { pub enum MemberValue { Primitive(Primitive), String(String), + List(Vec), } #[derive(Debug, Serialize, Deserialize, PartialEq, Hash, Eq, Clone)] @@ -418,6 +419,9 @@ impl From for member_value::ValueType { member_value::ValueType::Primitive(primitive.into()) } MemberValue::String(string) => member_value::ValueType::String(string), + MemberValue::List(list) => member_value::ValueType::List(proto::types::MemberValueList { + values: list.into_iter().map(|v| proto::types::MemberValue { value_type: Some(v.into()) }).collect(), + }), } } } From e4d9d861ae98385f1b9690716c9cd438f3329b35 Mon Sep 17 00:00:00 2001 From: Nasr Date: Fri, 20 Dec 2024 14:18:25 +0700 Subject: [PATCH 2/2] fmt --- crates/torii/grpc/src/types/mod.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/crates/torii/grpc/src/types/mod.rs b/crates/torii/grpc/src/types/mod.rs index c20d7483a2..6e088a7ae2 100644 --- a/crates/torii/grpc/src/types/mod.rs +++ b/crates/torii/grpc/src/types/mod.rs @@ -419,9 +419,14 @@ impl From for member_value::ValueType { member_value::ValueType::Primitive(primitive.into()) } MemberValue::String(string) => member_value::ValueType::String(string), - MemberValue::List(list) => member_value::ValueType::List(proto::types::MemberValueList { - values: list.into_iter().map(|v| proto::types::MemberValue { value_type: Some(v.into()) }).collect(), - }), + MemberValue::List(list) => { + member_value::ValueType::List(proto::types::MemberValueList { + values: list + .into_iter() + .map(|v| proto::types::MemberValue { value_type: Some(v.into()) }) + .collect(), + }) + } } } }