From 6dbd658ec95cb174698967b5fc663635b307b8e0 Mon Sep 17 00:00:00 2001 From: Nasr Date: Fri, 1 Nov 2024 09:52:22 -0400 Subject: [PATCH] fmt --- src/wasm/types.rs | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/wasm/types.rs b/src/wasm/types.rs index a616da4..575efd4 100644 --- a/src/wasm/types.rs +++ b/src/wasm/types.rs @@ -125,16 +125,19 @@ pub struct Entity(pub HashMap); impl From<&torii_grpc::types::schema::Entity> for Entity { fn from(value: &torii_grpc::types::schema::Entity) -> Self { let mut seen_models = HashMap::new(); - Self(value.models.iter().map(|m| { - let count = seen_models.entry(m.name.clone()).or_insert(0); - let name = if *count == 0 { - m.name.clone() - } else { - format!("{}-{}", m.name, count) - }; - *count += 1; - (name, m.into()) - }).collect()) + Self( + value + .models + .iter() + .map(|m| { + let count = seen_models.entry(m.name.clone()).or_insert(0); + let name = + if *count == 0 { m.name.clone() } else { format!("{}-{}", m.name, count) }; + *count += 1; + (name, m.into()) + }) + .collect(), + ) } }