Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
kariy committed Apr 4, 2024
1 parent b8e782e commit a2f920f
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion crates/args/src/account/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ impl WalletCommands {
[ChainId::options(), &["other"]].concat(),
)
.prompt()
.map(|chain| ChainId::from_str(&chain).ok())?;
.map(|chain| ChainId::from_str(chain).ok())?;

wallet.chain = chain;

Expand Down
2 changes: 1 addition & 1 deletion crates/args/src/commands/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ mod tests {
"key": "value"
});

let args = RpcArgs::parse_from(&[
let args = RpcArgs::parse_from([
"rpc",
"starknet_getStorageAt",
"123",
Expand Down
12 changes: 6 additions & 6 deletions crates/args/src/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,8 +461,8 @@ pub fn pretty_block_without_txs(block: &MaybePendingBlockWithTxs) -> String {
impl Pretty for DataAvailabilityMode {
fn prettify(&self) -> String {
match self {
DataAvailabilityMode::L1 => format!("L1"),
DataAvailabilityMode::L2 => format!("L2"),
DataAvailabilityMode::L1 => "L1".to_string(),
DataAvailabilityMode::L2 => "L2".to_string(),
}
}
}
Expand All @@ -476,8 +476,8 @@ impl Pretty for TransactionStatus {
TransactionStatus::AcceptedOnL2(s) => {
format!("ACCEPTED ON L2 ({})", s.prettify())
}
TransactionStatus::Received => format!("RECEIVED"),
TransactionStatus::Rejected => format!("REJECTED"),
TransactionStatus::Received => "RECEIVED".to_string(),
TransactionStatus::Rejected => "REJECTED".to_string(),
}
}
}
Expand All @@ -486,10 +486,10 @@ impl Pretty for TransactionExecutionStatus {
fn prettify(&self) -> String {
match self {
TransactionExecutionStatus::Succeeded => {
format!("Succeeded")
"Succeeded".to_string()
}
TransactionExecutionStatus::Reverted => {
format!("Reverted")
"Reverted".to_string()
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/args/src/opts/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ mod tests {

#[test]
fn parse_tx_options() {
let cli = TransactionOptions::command().get_matches_from(&[
let cli = TransactionOptions::command().get_matches_from([
"transaction_options",
"--signature",
"0x124142,0x3323234,0x12324131",
Expand Down
2 changes: 1 addition & 1 deletion crates/args/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ impl TypedValueParser for TokenAddressParser {
value => FieldElement::from_str(value).map_err(|e| match e {
FromStrError::InvalidCharacter => Error::raw(
ErrorKind::InvalidValue,
format!("value must be an address or one of the known tokens"),
"value must be an address or one of the known tokens".to_string(),
),
FromStrError::OutOfRange => Error::raw(
ErrorKind::InvalidValue,
Expand Down
2 changes: 1 addition & 1 deletion crates/rika/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ impl<P: Provider> Rika<P> {

if let Some(field) = field {
json = json
.get(&field)
.get(field)
.ok_or_else(|| eyre!("`{field}` is not a valid transaction receipt field."))?
.to_owned();
}
Expand Down

0 comments on commit a2f920f

Please sign in to comment.