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 de8fc2f
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 29 deletions.
6 changes: 1 addition & 5 deletions crates/dojo-lang/src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,7 @@ impl GeneratedFileAuxData for DojoAuxData {
self
}
fn eq(&self, other: &dyn GeneratedFileAuxData) -> bool {
if let Some(other) = other.as_any().downcast_ref::<Self>() {
self == other
} else {
false
}
if let Some(other) = other.as_any().downcast_ref::<Self>() { self == other } else { false }
}
}
impl AsDynGeneratedFileAuxData for DojoAuxData {
Expand Down
20 changes: 12 additions & 8 deletions crates/dojo-world/src/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,10 @@ impl Manifest {
.call(
FunctionCall {
contract_address: world_address,
calldata: vec![cairo_short_string_to_felt(&component.name)
.map_err(ManifestError::InvalidNameError)?],
calldata: vec![
cairo_short_string_to_felt(&component.name)
.map_err(ManifestError::InvalidNameError)?,
],
entry_point_selector: get_selector_from_name("component").unwrap(),
},
BlockId::Tag(BlockTag::Pending),
Expand All @@ -172,12 +174,14 @@ impl Manifest {
.call(
FunctionCall {
contract_address: world_address,
calldata: vec![cairo_short_string_to_felt(
// because the name returns by the `name` method of
// a system contract is without the 'System' suffix
system.name.strip_suffix("System").unwrap_or(&system.name),
)
.map_err(ManifestError::InvalidNameError)?],
calldata: vec![
cairo_short_string_to_felt(
// because the name returns by the `name` method of
// a system contract is without the 'System' suffix
system.name.strip_suffix("System").unwrap_or(&system.name),
)
.map_err(ManifestError::InvalidNameError)?,
],
entry_point_selector: get_selector_from_name("system").unwrap(),
},
BlockId::Tag(BlockTag::Pending),
Expand Down
6 changes: 1 addition & 5 deletions crates/dojo-world/src/migration/class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ pub struct ClassDiff {

impl StateDiff for ClassDiff {
fn is_same(&self) -> bool {
if let Some(remote) = self.remote {
self.local == remote
} else {
false
}
if let Some(remote) = self.remote { self.local == remote } else { false }
}
}

Expand Down
6 changes: 1 addition & 5 deletions crates/dojo-world/src/migration/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ pub struct ContractDiff {

impl StateDiff for ContractDiff {
fn is_same(&self) -> bool {
if let Some(remote) = self.remote {
self.local == remote
} else {
false
}
if let Some(remote) = self.remote { self.local == remote } else { false }
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/katana/rpc/src/api/starknet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pub trait StarknetApi {

#[method(name = "getNonce")]
async fn nonce(&self, block_id: BlockId, contract_address: FieldElement)
-> Result<Felt, Error>;
-> Result<Felt, Error>;

#[method(name = "blockNumber")]
async fn block_number(&self) -> Result<u64, Error>;
Expand Down
6 changes: 1 addition & 5 deletions crates/torii/src/graphql/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,6 @@ impl ScalarType {
}

pub fn as_sql_type(&self) -> &'static str {
if self.is_numeric_type() {
"INTEGER"
} else {
"TEXT"
}
if self.is_numeric_type() { "INTEGER" } else { "TEXT" }
}
}

0 comments on commit de8fc2f

Please sign in to comment.