diff --git a/crates/torii/core/src/query_queue.rs b/crates/torii/core/src/query_queue.rs index 3362a77caf..5dfad77113 100644 --- a/crates/torii/core/src/query_queue.rs +++ b/crates/torii/core/src/query_queue.rs @@ -115,10 +115,8 @@ impl QueryQueue { .fetch_one(&mut *tx) .await?; let mut entity_updated = EntityUpdated::from_row(&row)?; - entity_updated.updated_model = Some(Ty::Struct(Struct { - name: entity.ty.name(), - children: vec![], - })); + entity_updated.updated_model = + Some(Ty::Struct(Struct { name: entity.ty.name(), children: vec![] })); let count = sqlx::query_scalar::<_, i64>( "SELECT count(*) FROM entity_model WHERE entity_id = ?", diff --git a/crates/torii/grpc/src/server/mod.rs b/crates/torii/grpc/src/server/mod.rs index ffd4059621..4dd245d03a 100644 --- a/crates/torii/grpc/src/server/mod.rs +++ b/crates/torii/grpc/src/server/mod.rs @@ -106,13 +106,11 @@ impl DojoWorld { Arc::clone(&state_diff_manager), )); - tokio::task::spawn(subscriptions::entity::Service::new( - Arc::clone(&entity_manager), - )); + tokio::task::spawn(subscriptions::entity::Service::new(Arc::clone(&entity_manager))); - tokio::task::spawn(subscriptions::event_message::Service::new( - Arc::clone(&event_message_manager), - )); + tokio::task::spawn(subscriptions::event_message::Service::new(Arc::clone( + &event_message_manager, + ))); tokio::task::spawn(subscriptions::event::Service::new(Arc::clone(&event_manager))); diff --git a/crates/torii/grpc/src/server/subscriptions/entity.rs b/crates/torii/grpc/src/server/subscriptions/entity.rs index 3217d88992..6511e218ec 100644 --- a/crates/torii/grpc/src/server/subscriptions/entity.rs +++ b/crates/torii/grpc/src/server/subscriptions/entity.rs @@ -82,19 +82,11 @@ pub struct Service { } impl Service { - pub fn new( - subs_manager: Arc, - ) -> Self { - Self { - subs_manager, - simple_broker: Box::pin(SimpleBroker::::subscribe()), - } + pub fn new(subs_manager: Arc) -> Self { + Self { subs_manager, simple_broker: Box::pin(SimpleBroker::::subscribe()) } } - async fn publish_updates( - subs: Arc, - entity: &Entity, - ) -> Result<(), Error> { + async fn publish_updates(subs: Arc, entity: &Entity) -> Result<(), Error> { let mut closed_stream = Vec::new(); let hashed = Felt::from_str(&entity.id).map_err(ParseError::FromStr)?; let keys = entity @@ -196,9 +188,7 @@ impl Service { let resp = proto::world::SubscribeEntityResponse { entity: Some(proto::types::Entity { hashed_keys: hashed.to_bytes_be().to_vec(), - models: vec![ - model.into() - ], + models: vec![model.into()], }), subscription_id: *idx, }; diff --git a/crates/torii/grpc/src/server/subscriptions/event_message.rs b/crates/torii/grpc/src/server/subscriptions/event_message.rs index c08d4f08a5..d2260b0044 100644 --- a/crates/torii/grpc/src/server/subscriptions/event_message.rs +++ b/crates/torii/grpc/src/server/subscriptions/event_message.rs @@ -76,13 +76,8 @@ pub struct Service { } impl Service { - pub fn new( - subs_manager: Arc, - ) -> Self { - Self { - subs_manager, - simple_broker: Box::pin(SimpleBroker::::subscribe()), - } + pub fn new(subs_manager: Arc) -> Self { + Self { subs_manager, simple_broker: Box::pin(SimpleBroker::::subscribe()) } } async fn publish_updates( @@ -174,9 +169,7 @@ impl Service { let resp = proto::world::SubscribeEntityResponse { entity: Some(proto::types::Entity { hashed_keys: hashed.to_bytes_be().to_vec(), - models: vec![ - model.into() - ], + models: vec![model.into()], }), subscription_id: *idx, };