Skip to content

Commit

Permalink
chore: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Larkooo committed Jul 17, 2024
1 parent b518f24 commit e3913f1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
10 changes: 4 additions & 6 deletions crates/torii/grpc/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,14 @@ impl WorldClient {
) -> Result<(), Error> {
let clauses = clauses.into_iter().map(|c| c.into()).collect();

Ok(self
.inner
self.inner
.update_entities_subscription(UpdateEntitiesSubscriptionRequest {
subscription_id,
clauses,
})
.await
.map_err(Error::Grpc)
.map(|res| res.into_inner())?)
.map(|res| res.into_inner())
}

/// Subscribe to event messages of a World.
Expand Down Expand Up @@ -169,15 +168,14 @@ impl WorldClient {
clauses: Vec<EntityKeysClause>,
) -> Result<(), Error> {
let clauses = clauses.into_iter().map(|c| c.into()).collect();
Ok(self
.inner
self.inner
.update_event_messages_subscription(UpdateEntitiesSubscriptionRequest {
subscription_id,
clauses,
})
.await
.map_err(Error::Grpc)
.map(|res| res.into_inner())?)
.map(|res| res.into_inner())
}

/// Subscribe to the events of a World.
Expand Down
4 changes: 2 additions & 2 deletions crates/torii/grpc/src/server/subscriptions/entity.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::collections::{BTreeMap, HashMap, HashSet};
use std::collections::HashMap;
use std::future::Future;
use std::pin::Pin;
use std::str::FromStr;
Expand Down Expand Up @@ -123,7 +123,7 @@ impl Service {
// matches the key pattern of the subscriber.
if !sub.clauses.iter().any(|clause| match clause {
EntityKeysClause::HashedKeys(hashed_keys) => {
return hashed_keys.is_empty() || hashed_keys.contains(&hashed);
hashed_keys.is_empty() || hashed_keys.contains(&hashed)
}
EntityKeysClause::Keys(clause) => {
// if we have a model clause, then we need to check that the entity
Expand Down
6 changes: 3 additions & 3 deletions crates/torii/grpc/src/server/subscriptions/event_message.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::collections::{BTreeMap, HashMap, HashSet};
use std::collections::HashMap;
use std::future::Future;
use std::pin::Pin;
use std::str::FromStr;
Expand All @@ -10,7 +10,7 @@ use futures_util::StreamExt;
use rand::Rng;
use sqlx::{Pool, Sqlite};
use starknet::core::types::Felt;
use tokio::sync::mpsc::{channel, Receiver, Sender};
use tokio::sync::mpsc::{channel, Receiver};
use tokio::sync::RwLock;
use torii_core::cache::ModelCache;
use torii_core::error::{Error, ParseError};
Expand Down Expand Up @@ -117,7 +117,7 @@ impl Service {
// matches the key pattern of the subscriber.
if !sub.clauses.iter().any(|clause| match clause {
EntityKeysClause::HashedKeys(hashed_keys) => {
return hashed_keys.is_empty() || hashed_keys.contains(&hashed);
hashed_keys.is_empty() || hashed_keys.contains(&hashed)
}
EntityKeysClause::Keys(clause) => {
// if we have a model clause, then we need to check that the entity
Expand Down

0 comments on commit e3913f1

Please sign in to comment.