Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
kariy committed Sep 28, 2023
1 parent 633b512 commit f770e94
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 53 deletions.
13 changes: 7 additions & 6 deletions crates/torii/client/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,14 @@ impl ClientBuilder {
let provider = JsonRpcClient::new(HttpTransport::new(Url::parse(&rpc_url)?));
let world_reader = WorldContractReader::new(world, &provider);

for EntityComponent { component, keys } in subbed_entities.entities.read().iter() {
// TODO: change this to querying the gRPC endpoint instead
let subbed_entities = subbed_entities.entities.read().clone();
for EntityComponent { component, keys } in subbed_entities {
let component_reader =
world_reader.component(component, BlockId::Tag(BlockTag::Pending)).await?;
let values = component_reader
.entity(keys.to_owned(), BlockId::Tag(BlockTag::Pending))
.await?;
client_storage.set_entity((component.to_owned(), keys.to_owned()), values)?;
world_reader.component(&component, BlockId::Tag(BlockTag::Pending)).await?;
let values =
component_reader.entity(keys.clone(), BlockId::Tag(BlockTag::Pending)).await?;
client_storage.set_entity((component, keys), values)?;
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/torii/client/src/client/subscription.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,6 @@ mod tests {
subscribed_entities.subscribed_storage_addresses.read().len();

assert_eq!(actual_storage_addresses_count_after, 0);
assert!(subscribed_entities.entities.read().contains(&entity) == false);
assert!(!subscribed_entities.entities.read().contains(&entity));
}
}
3 changes: 0 additions & 3 deletions crates/torii/client/wasm/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
use std::str::FromStr;

use futures::FutureExt;
use starknet::core::types::FieldElement;
use wasm_bindgen::prelude::*;

mod utils;

type JsFieldElement = JsValue;
type JsEntityComponent = JsValue;

Expand Down
23 changes: 0 additions & 23 deletions crates/torii/client/wasm/src/utils.rs

This file was deleted.

20 changes: 0 additions & 20 deletions crates/torii/client/wasm/tests/wasm.rs

This file was deleted.

0 comments on commit f770e94

Please sign in to comment.