Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
tarrencev committed Aug 5, 2023
1 parent 9d8a819 commit eaeb700
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 22 deletions.
6 changes: 2 additions & 4 deletions crates/dojo-client/src/contract/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,8 @@ impl<'a, P: Provider + Sync> SystemReader<'a, P> {
.call(
FunctionCall {
contract_address: world.address,
calldata: vec![
cairo_short_string_to_felt(&name)
.map_err(SystemReaderError::CairoShortStringToFeltError)?,
],
calldata: vec![cairo_short_string_to_felt(&name)
.map_err(SystemReaderError::CairoShortStringToFeltError)?],
entry_point_selector: get_selector_from_name("system").unwrap(),
},
block_id,
Expand Down
2 changes: 1 addition & 1 deletion crates/katana/core/src/backend/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ impl Backend {

// apply the pending state diff to the state
async fn apply_pending_state(&self) {
let Some(ref mut pending_block ) = *self.pending_block.write().await else {
let Some(ref mut pending_block) = *self.pending_block.write().await else {
panic!("failed to apply pending state: no pending block")
};

Expand Down
5 changes: 2 additions & 3 deletions crates/katana/core/src/sequencer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,8 @@ impl KatanaSequencer {
// &self,
// transaction: DeployAccountTransaction,
// balance: u64,
// ) -> SequencerResult<(TransactionHash, ContractAddress)> {
// let (transaction_hash, contract_address) =
// self.add_deploy_account_transaction(transaction).await;
// ) -> SequencerResult<(TransactionHash, ContractAddress)> { let (transaction_hash,
// contract_address) = self.add_deploy_account_transaction(transaction).await;

// let deployed_account_balance_key =
// get_storage_var_address("ERC20_balances", &[*contract_address.0.key()])
Expand Down
12 changes: 10 additions & 2 deletions crates/sozo/src/ops/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,23 @@ pub async fn execute(command: SystemCommands, env_metadata: Option<Value>) -> Re
.iter()
.enumerate()
.filter_map(|(i, d)| {
if d.read { Some(format!("{}.{}", i + 1, d.name.clone())) } else { None }
if d.read {
Some(format!("{}.{}", i + 1, d.name.clone()))
} else {
None
}
})
.collect::<Vec<_>>();

let write = deps
.iter()
.enumerate()
.filter_map(|(i, d)| {
if d.write { Some(format!("{}. {}", i + 1, d.name.clone())) } else { None }
if d.write {
Some(format!("{}. {}", i + 1, d.name.clone()))
} else {
None
}
})
.collect::<Vec<_>>();

Expand Down
24 changes: 12 additions & 12 deletions rustfmt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ use_try_shorthand = true
max_width = 100

# Unstable features below
unstable_features = true
version = "Two"
comment_width = 100
format_code_in_doc_comments = true
format_macro_bodies = true
format_macro_matchers = true
format_strings = true
imports_granularity = "Module"
group_imports = "StdExternalCrate"
normalize_comments = true
normalize_doc_attributes = true
wrap_comments = true
# unstable_features = true
# version = "Two"
# comment_width = 100
# format_code_in_doc_comments = true
# format_macro_bodies = true
# format_macro_matchers = true
# format_strings = true
# imports_granularity = "Module"
# group_imports = "StdExternalCrate"
# normalize_comments = true
# normalize_doc_attributes = true
# wrap_comments = true

# To use these settings in vscode, add the following line to your settings:
# "rust-analyzer.rustfmt.overrideCommand": [
Expand Down

0 comments on commit eaeb700

Please sign in to comment.